schrodinger.test.pytest.sessionfixture module

Fixtures that are encoded into pytest and run as part of each test. These are never explicitly called and only used by test machinery.

schrodinger.test.pytest.sessionfixture.ensure_maestro_idempotent()[source]
schrodinger.test.pytest.sessionfixture.ensure_JOB_SERVER_idempotent()[source]
schrodinger.test.pytest.sessionfixture.ensure_LAST_EXCEPTION_cleared()[source]
schrodinger.test.pytest.sessionfixture.disable_multiprocessing(monkeypatch)[source]

Disable multiprocessing.Pool in all tests. This was causing memory issues in certain cases. Any test that tries to access multiprocessing.Pool will get an AttributeError when run.

schrodinger.test.pytest.sessionfixture.disable_qmessagebox()[source]

Change QMessageBox to raise RuntimeError so they won’t hang the test harness opaquely.

schrodinger.test.pytest.sessionfixture.prevent_jobdirdlg_jobhub_connection()[source]

Prevent jobdirdlg from connecting to the jobhub callback. Connecting to this callback in multiple unit tests causes issues on Windows builds due to the short periodicity of the callback.

schrodinger.test.pytest.sessionfixture.use_mmpref_sandbox(tmpdir_factory)[source]

Sets preferences (backed by QSettings) to a unique file. Allows parallel xdist tests to not stomp on each other.

schrodinger.test.pytest.sessionfixture.task_wait_with_default_timeout()[source]

Set a default timeout when waiting on tasks in tests. If the default timeout is hit, then raise an error.

schrodinger.test.pytest.sessionfixture.task_cleanup_tmpdirs()[source]

Clean up all tempdirs created by tasks.

schrodinger.test.pytest.sessionfixture.disallow_mock_in_swig(request)[source]
schrodinger.test.pytest.sessionfixture.delete_job_manager(request)[source]
schrodinger.test.pytest.sessionfixture.force_no_run_in_dir(pytestconfig)[source]

Change back to the original working directory. The cwd is modified by the stupid run-in-dir option to our pytest for mmshare code (to be removed in PYTHON-3408), but this fixture this overrides that.

schrodinger.test.pytest.sessionfixture.start_qapp(config)[source]

Start a qapp in this process.

schrodinger.test.pytest.sessionfixture.runtest_setup(item)[source]

Execute each test in the directory where the test file lives.

Capture exceptions that occur outside of the main thread (for instance in event loops).

schrodinger.test.pytest.sessionfixture.runtest_teardown(item, nextitem)[source]