schrodinger.test.pytest.startup module¶
Schrodinger-specific modification to pytest startup.
- class schrodinger.test.pytest.startup.SchrodingerIniOptions(value)¶
Bases:
enum.Enum
An enumeration.
- ALLOW_REMOTE_JOBS = 'allow_remote_jobs'¶
- DISALLOW_MOCK_IN_SWIG = 'disallow_mock_in_swig'¶
- WARNINGS_AS_ERRORS = 'warnings_as_errors'¶
- class schrodinger.test.pytest.startup.DeferXdistPlugin¶
Bases:
object
Plugin to defer pytest-xdist hook functions.
- pytest_testnodedown(node, error)¶
Check for core dumps if a node crashes
- schrodinger.test.pytest.startup.configure(config)¶
Post-Process the pytest configuration. Basically to overload the -m argument and play well with –pypath.
- schrodinger.test.pytest.startup.addoption(parser)¶
Add Schrodinger options to run the post tests, or just the fastest tests.
This is a pytest hook.
- schrodinger.test.pytest.startup.extend_pythonpath(additional_paths)¶
Add “additional_paths” to the PYTHONPATH. Also adds schrodinger.test and the test_modules directory.
- schrodinger.test.pytest.startup.cmdline_main(config)¶
Run the py.test main loop.
Only affects if an option was requested that necessitates restarting toplevel.
- class schrodinger.test.pytest.startup.CurrentSession(rootdir, pluginmanager)¶
Bases:
object
- __init__(rootdir, pluginmanager)¶
- schrodinger.test.pytest.startup.set_current_session(config)¶
- Parameters
config (pytest.config.Config) – current config object for pytest
Sets a module level variable to refer to in case of crash.
- schrodinger.test.pytest.startup.can_write_bytecode()¶
Return whether we can write bytecode to the __pycache__ directory.
- schrodinger.test.pytest.startup.disable_bytecode_if_not_writable()¶
Determines if we need to disable bytecode writing, due to pytest using atomicwrites package, which uses mkstemp. It will attempt to create 2 billion files on windows, per file imported by pytest. https://bugs.python.org/issue22107
- schrodinger.test.pytest.startup.get_schrodinger_package_dirs()¶
Get directories under the schrodinger module that contain code from product repositories outside of mmshare