PyTest :: Python Testing framework for unit testing, system testing , integration testing everything ....
PyTest Rough Points:
1.capsys -> The capsys builtin fixture provides two bits of functionality: it allows you to retrieve stdout and stderr from some code, and it disables output capture temporarily. Let’s take a look at retrieving stdout and stderr.
2. Marker -> can be specified in the pytest.ini to mark the test.
3. Incremental -> if it fails we can asks remaining all to fail by calling pytest.mark.incremental decorator
4. Python Fixtures -> Autouse , scope=[function, module, session etc] for dependency injection.
5. Python Fixtures can take parameters as well.
6. Pytest to parallelise the test cases using pytest-xdist like due to multiple platforms , multiple nodes etc
7. Fixtures in Fixtures can be used like DB table existence checking can use another fixture for DB connection.
8. Within the fixture we can skip/fail TCs if that Fixture function has abnormal o/p behaviour.
9. Assert -> Pytest test case validation.
10. Conftest.py -> for the Command Line Arguments to pytests using pytest_addoption hooks.
Comments