Package schrodinger :: Package test :: Module pytest_customizations
[hide private]
[frames] | no frames]

Module pytest_customizations

Local Schrodinger py.test customizations.

todo: It would be nice to have a SCHRODINGER traceback printer that removed $SCHRODINGER from each path.

Classes [hide private]
  ExecutableFile
A compiled executable file that should be executed as a test.
  ProcessDied
  KilledProcess
  ExecutableTest
Use $SCHRODINGER/run to execute a file with no arguments.
Functions [hide private]
 
pytest_runtest_setup(item)
Execute each test in the directory where the test file lives.
 
pytest_runtest_teardown(item, nextitem)
 
pytest_addoption(parser)
Add Schrodinger options to run the post tests, or just the fastest tests.
 
extend_pythonpath(additional_paths)
Add "additional_paths" to the PYTHONPATH.
 
schrodinger_pytest_load_initial_conftests(early_config, parser, args)
 
pytest_configure(config)
Post-Process the pytest configuration.
 
pytest_configure_node(node)
If tests are being parallelized using xdist is being used, start a qapp in each process.
 
pytest_report_teststatus(report)
Put Killed tests into a separate group from other failures.
 
pytest_terminal_summary(terminalreporter)
Print Killed tests.
 
pytest_unconfigure(config)
Pytest function: Clean up leftover processes, and report an error if any are found.
 
pytest_collect_file(parent, path)
Pytest function: Should "path" be collected as a test?
 
_read_fd_nowait(fd)
Read all current output from a file descriptor without waiting.
 
start_qapp()
Start a qapp in this process.
Variables [hide private]
  SCHRODINGER_RUN = '/nfs/builds/objects/NB/2016-2/Linux-x86_64/...
  MEMTEST = ('/nfs/builds/objects/NB/2016-2/Linux-x86_64/build-1...
  __package__ = 'schrodinger.test'
Function Details [hide private]

pytest_runtest_setup(item)

 

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).

pytest_addoption(parser)

 

Add Schrodinger options to run the post tests, or just the fastest tests.

This is a pytest hook.

extend_pythonpath(additional_paths)

 

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

pytest_configure(config)

 

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

Decorators:
  • @pytest.mark.tryfirst

pytest_terminal_summary(terminalreporter)

 

Print Killed tests. Change reporting for failed tests.

pytest_unconfigure(config)

 

Pytest function: Clean up leftover processes, and report an error if any are found.

This is done as late as possible so that parallel py.tests from pytest-xdist won't interfere.

pytest_collect_file(parent, path)

 

Pytest function: Should "path" be collected as a test?

Adds compiled tests.


Variables Details [hide private]

SCHRODINGER_RUN

Value:
'/nfs/builds/objects/NB/2016-2/Linux-x86_64/build-131/run'

MEMTEST

Value:
('/nfs/builds/objects/NB/2016-2/Linux-x86_64/build-131/run',
 'valgrind',
 '--tool=memcheck',
 '--leak-resolution=high',
 '--time-stamp=yes',
 '--num-callers=50',
 '--gen-suppressions=all',
 '--leak-check=full',
...