do not capture output
run in verbose mode
Getting the list of all tests
All tests of the test suite:
bash
pytest --collect-only -q
All tests of a given test file:
bash
pytest tests/test_optimization.py --collect-only -q
Run a specific test module
To run an individual test module:
bash
pytest tests/test_logging.py
Run specific tests
Since unittest is used inside most of the tests, to run specific subtests you need to know the name of the unittest
class containing those tests. For example, it could be:
bash
pytest tests/test_optimization.py::OptimizationTest::test_adam_w
Here:
tests/test_optimization.py - the file with tests
OptimizationTest - the name of the class
test_adam_w - the name of the specific test function
If the file contains multiple classes, you can choose to run only tests of a given class. For example:
