Closed sfsinger19103 closed 3 years ago
See https://docs.pytest.org/en/latest/how-to/usage.html#calling-pytest-from-python-code
Calling pytest from Python code You can invoke pytest from Python code directly:
retcode = pytest.main() this acts as if you would call “pytest” from the command line. It will not raise SystemExit but return the exit code instead. You can pass in options and arguments:
retcode = pytest.main(["-x", "mytestdir"])
Ideally, would look up jurisdiction id and election id only once during a testing session.
Currently a person wanting to test a set of results for a single election-jurisdiction pair has to edit a python file
test_<juris>_<election>.py
. Instead, user should be required only to put info into a tab-separated text file of a specified form.010_load_and_test_all.py
with a pytest test that creates and destroys the temp database.