3 ms·
To add to this, the test ID pytest prints when a test has had a failure/warning is the same form you can call with pytest to run the test. For example, let's sa
by ssl232 4y ago
To add to this, the test ID pytest prints when a test has had a failure/warning is the same form you can call with pytest to run the test. For example, let's say pytest outputs this:
=============================== warnings summary ===============================
tests/parser/test_expressions.py::test_complex[+inf+1.23e7j-(inf+12300000j)]
You can run just that particular test (with that particular parametrized input) with
pytest tests/parser/test_expressions.py::test_complex[+inf+1.23e7j-(inf+12300000j)]
- BerislavLopac 4y agoTo add to that, pytest's parametrized IDs can be fully controlled in the test code [0], so your test can be something like: pytest tests/parser/test_expressions.py::test_complex[special_case_7] [0] https://docs.pytest.org/en/7.1.x/example/parametrize.html#different-options-for-test-ids https://docs.pytest.org/en/7.1.x/example/parametrize.html#di...
- masklinn 4y agoAlso pytest has flags like —lf and —sw to rerun failed tests or tackle test suites with lots of failures.