schrodinger.test.pytest.startup module

Schrodinger-specific modification to pytest startup.

class schrodinger.test.pytest.startup.SchrodingerIniOptions(value)[source]

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[source]

Bases: object

Plugin to defer pytest-xdist hook functions.

pytest_testnodedown(node, error)[source]

Check for core dumps if a node crashes

schrodinger.test.pytest.startup.configure(config)[source]

Post-Process the pytest configuration. Basically to overload the -m argument and play well with –pypath.

schrodinger.test.pytest.startup.addoption(parser)[source]

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)[source]

Add “additional_paths” to the PYTHONPATH. Also adds schrodinger.test and the test_modules directory.

schrodinger.test.pytest.startup.cmdline_main(config)[source]

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)[source]

Bases: object

__init__(rootdir, pluginmanager)[source]
schrodinger.test.pytest.startup.set_current_session(config)[source]
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()[source]

Return whether we can write bytecode to the __pycache__ directory.

schrodinger.test.pytest.startup.disable_bytecode_if_not_writable()[source]

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()[source]

Get directories under the schrodinger module that contain code from product repositories outside of mmshare