schrodinger.test.pytest.fixture module¶
Features that a developer might use when writing tests.
- schrodinger.test.pytest.fixture.unittest_preset_manager()¶
A fixture that mocks out the PresetManager with a PresetManager that uses the current working directory as the presets directory. This prevents reliance on system state.
- schrodinger.test.pytest.fixture.json_version()¶
A fixture that mocks out the version used by schrodinger.models.json.JsonableClassMixin. By default, the version returned will be the current mmshare version. The return_value of the fixture can be adjusted to change the version. Example:
def my_test(json_version): from schrodinger.models import json from schrodinger import get_mmshare_version foo = json.JsonableClassMixin() assert foo.get_version() == get_mmshare_version() json_version.return_value = 10 assert foo.get_version() == 10
- schrodinger.test.pytest.fixture.tmp_cwd(tmpdir_factory, request, monkeypatch)¶
- schrodinger.test.pytest.fixture.log_to_stdout()¶
Log to stdout instead of files
- schrodinger.test.pytest.fixture.allow_memtest(request)¶
- schrodinger.test.pytest.fixture.fast_jobdj()¶
Use this fixture to make jobDJ use minimal delays in updating, at the expense of throttling the CPU.
- schrodinger.test.pytest.fixture.mock_gpgpu_hosts_env()¶
- schrodinger.test.pytest.fixture.mock_task_helper()¶
Fixture for mocking task methods that are required for the task to finish without leaving the task with status RUNNING.
Usage:
def test_foo_task(mock_task_helper): task = FooTask() mock_task_helper.patch_run(task) task.start() assert task.status is task.FAILED
- schrodinger.test.pytest.fixture.no_pandastools_side_effects()¶
If PandasTools from rdkit.Chem is imported into the global namespace it has unexpected results later on. This fixture confirms that before and after the test the default RDKit string rendering is used.