{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/5"}],"enrichment":{"capability":"Provides pytest markers (@pytest.mark.raises and @pytest.mark.setup_raises) to assert that test code raises expected exceptions, functioning as a decorator alternative to pytest.raises context managers.","skillfed_tags":["pytest-plugin","exception-testing"],"use_cases":["Mark parametrized test cases where different parameters should raise different exception types, using pytest.param with the marker.","Assert that fixture setup or custom pytest hooks raise expected errors during the pytest_runtest_setup phase.","Replace verbose `with pytest.raises(...)` blocks with a cleaner decorator syntax for entire test functions.","Verify that code raises a specific exception type with a message matching a regex pattern or substring."],"what_it_does":"pytest-raises is a pytest plugin that lets you mark test functions with decorators to assert they raise expected exceptions. Instead of wrapping code in a `with pytest.raises(...)` context manager, you decorate the entire test function with `@pytest.mark.raises()` or `@pytest.mark.setup_raises()` to declare that an exception should be raised during test execution or setup, respectively. The plugin accepts optional parameters to specify the exception type, match the exception message by substring or regex, and apply regex flags.\n\nThe main use case is marking tests (especially in parametrized test suites) where raising an exception is the expected behavior\u2014the test passes only if the exception is raised. It also provides `@pytest.mark.setup_raises()` for the uncommon case where you need to verify that an exception occurs during pytest's setup phase rather than during the test itself. The package depends only on pytest and installs with low friction, but has been dormant since 2020 with no recent maintenance.","worth_installing":"Yes, if you are already on pytest 2.8.1+ and want decorator-based exception assertions instead of context managers. However, exercise caution: the package is dormant (last release 2020-04-23), so compatibility with modern pytest versions is unverified, and the license is unclear. Test it in a non-critical project first, or consider whether the built-in `with pytest.raises(...)` context manager meets your needs instead."},"id":"pytest-raises","links":{"html":"https://skillfed.io/packages/pytest-raises","md":"https://skillfed.io/packages/pytest-raises.md","pypi":"https://pypi.org/project/pytest-raises/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2020-04-23","license_spdx":null,"license_treatment":"unclear","name":"pytest-raises","python_support":"unspecified","summary":"An implementation of pytest.raises as a pytest.mark fixture"},"popularity":{"monthly_downloads":159704,"position":10691,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.11"}
