学习笔记之pytest
pytest: helps you write better programs — pytest documentation
- https://docs.pytest.org/en/stable/
- Installation and Getting Started — pytest documentation
pytestwill run all files of the form test_*.py or *_test.py in the current directory and its subdirectories. More generally, it follows standard test discovery rules.- Execute the test function with “quiet” reporting mode:
- $ pytest -q test_sysexit.py
pytestdiscovers all tests following its Conventions for Python test discovery, so it finds bothtest_prefixed functions. There is no need to subclass anything, but make sure to prefix your class withTestotherwise the class will be skipped.
- pytest fixtures: explicit, modular, scalable — pytest documentation
- Asserting about exceptions with pytest.raises
List of unit testing frameworks - Wikipedia
- https://en.wikipedia.org/wiki/List_of_unit_testing_frameworks
浙公网安备 33010602011771号