{"id":8542,"library":"pytest-skip-slow","title":"pytest-skip-slow","description":"pytest-skip-slow is a pytest plugin that enhances test execution by allowing users to mark tests as 'slow'. By default, tests marked with `@pytest.mark.slow` are skipped, helping maintain a fast local development feedback loop. These slow tests can then be explicitly included using the `--slow` command-line option. The current version is 0.0.5, released in February 2023, indicating a mature but infrequently updated project.","status":"active","version":"0.0.5","language":"en","source_language":"en","source_url":"https://github.com/okken/pytest-skip-slow","tags":["pytest","plugin","testing","skip","slow","performance"],"install":[{"cmd":"pip install pytest-skip-slow","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"This is a pytest plugin and requires pytest to function.","package":"pytest","optional":false},{"reason":"Requires Python version 3.7 or higher.","package":"python","optional":false}],"imports":[{"note":"pytest-skip-slow is a plugin that integrates with pytest's marking system; it does not have direct Python imports from the plugin itself.","symbol":"@pytest.mark.slow","correct":"import pytest\n\n@pytest.mark.slow\ndef test_my_slow_function():\n    ..."}],"quickstart":{"code":"import pytest\nimport time\n\ndef test_fast_calculation():\n    assert 1 + 1 == 2\n\n@pytest.mark.slow\ndef test_long_running_process():\n    time.sleep(2) # Simulate a slow operation\n    assert True\n\n# To run fast tests (skipping slow by default):\n# $ pytest\n\n# To include slow tests:\n# $ pytest --slow\n\n# To run ONLY slow tests:\n# $ pytest -m slow --slow","lang":"python","description":"Mark your long-running tests with `@pytest.mark.slow`. By default, `pytest` will skip these tests after the plugin is installed. To include and run these slow tests, use the `--slow` command-line option. To run only slow tests, combine with the marker expression `-m slow`."},"warnings":[{"fix":"Use `pytest -m slow --slow` to execute only the tests marked as slow.","message":"Running `pytest -m slow` alone will still skip tests marked with `@pytest.mark.slow` if `pytest-skip-slow` is active, as its default behavior is to skip them. To run *only* slow tests, you must explicitly include them with `--slow`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Add `slow: marks tests as slow` under the `[pytest]` section in your `pytest.ini` file.","message":"Pytest recommends declaring custom markers in your `pytest.ini` file to prevent `PytestUnknownMarkWarning`. While `pytest-skip-slow` provides the functionality, adding 'slow' to `markers` section in `pytest.ini` is a good practice.","severity":"gotcha","affected_versions":"All versions of pytest and pytest-skip-slow"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Ensure `pytest-skip-slow` is installed in your active Python environment: `pip install pytest-skip-slow`.","cause":"The `pytest-skip-slow` plugin is either not installed, or pytest is not detecting it correctly in your environment.","error":"pytest: error: unrecognized arguments: --slow"},{"fix":"To include and run these tests, execute `pytest --slow`.","cause":"Tests marked with `@pytest.mark.slow` are being skipped by default, which is the intended behavior of the plugin when the `--slow` flag is not present.","error":"=========================== 0 passed, 1 skipped in 0.XXs =========================== (when expecting slow tests to run)"},{"fix":"Add `markers = slow: marks tests as slow` to the `[pytest]` section of your `pytest.ini` file to suppress this warning.","cause":"This is a warning from pytest itself, indicating that the `slow` marker is used but not explicitly declared in the `pytest.ini` configuration file.","error":"PytestCollectionWarning: 'slow' not found in 'markers' configuration option."}]}