schrodinger.test.pytest.runtest module

schrodinger.test.pytest.runtest.runtestloop_isolate(session)

Run tests in multiple subprocesses without using xdist.

schrodinger.test.pytest.runtest.filter_pytest_args(argv)

Extract args that should be passed to each test batch

Returns

List of arguments to pass to subprocesses and the basename for the passed junit xml file, if any

Return type

tuple(list, Optional[str])

schrodinger.test.pytest.runtest.get_tests(session)

Divide tests into batches by test owner

Returns

Information about a test batch (owner and list of test files)

Return type

Iterable(str, list)

schrodinger.test.pytest.runtest.get_logname(test_info, junit_base=None)

Get the log filename for a batch of tests.

Parameters
  • test_info (tuple(str, list)) – Info about this batch of tests (owner and files)

  • junit_base – Basename of the junit XML file (used to create logname)

schrodinger.test.pytest.runtest.start_subprocess(cmd, test_info, log_fh, junit_base=None)

Start a test subprocess.

Parameters
  • cmd (list[str]) – Base test command

  • test_info (tuple(str, list)) – Info about this batch of tests (owner and files)

  • log_fh (io.TextIOWrapper) – Open filehandle for logging

  • junit_base (str) – Basename of the junit XML file (used to create logname)

Return type

subprocess.Popen

schrodinger.test.pytest.runtest.poll_subprocesses(running_procs, passed_runs, failed_runs)

Poll subprocesses and remove ones that are done running.

Note: All arguments are mutated in place

Parameters
  • running_procs – Dict of running processes

  • passed_runs – List of keys for processes that succeeded

  • failed_runs – List of keys for processes that failed

schrodinger.test.pytest.runtest.report(passed_logfiles, failed_logfiles, owner_dict)

Given passing and failing log files, produce a summary

Parameters

owner_dict – Dictionary mapping log filename to test owner

Returns

A list of log lines and a list of owners of failed tests

Return type

tuple(list, list)