English 中文(简体)
Pytest - Summary
  • 时间:2024-12-22

Pytest - Summary


Previous Page Next Page  

In this pytest tutorial, we covered the following areas −

    Instalpng pytest..

    Identifying test files and test functions.

    Executing all test files using pytest –v.

    Executing specific file usimng pytest <filename> -v.

    Execute tests by substring matching pytest -k <substring> -v.

    Execute tests based on markers pytest -m <marker_name> -v.

    Creating fixtures using @pytest.fixture.

    conftest.py allows accessing fixtures from multiple files.

    Parametrizing tests using @pytest.mark.parametrize.

    Xfaipng tests using @pytest.mark.xfail.

    Skipping tests using @pytest.mark.skip.

    Stop test execution on n failures using pytest --maxfail = <num>.

    Running tests in parallel using pytest -n <num>.

    Generating results xml using pytest -v --junitxml = "result.xml".

Advertisements