diff --git a/.vscode/launch.json b/.vscode/launch.json index 36d8f503..7d563e00 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -14,10 +14,6 @@ "debug-test" ], "console": "integratedTerminal", - "env": { - // Enable break on exception when debugging tests (see: tests/conftest.py) - "PYTEST_RAISE": "1", - }, } ] } diff --git a/tests/conftest.py b/tests/conftest.py index ebe9c10f..e69de29b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,21 +0,0 @@ -import os -from typing import Any - -import pytest - -# Prevent pytest from catching exceptions when debugging in vscode so that break on -# exception works correctly (see: https://github.com/pytest-dev/pytest/issues/7409) -if os.getenv("PYTEST_RAISE", "0") == "1": - - @pytest.hookimpl(tryfirst=True) - def pytest_exception_interact(call: pytest.CallInfo[Any]): - if call.excinfo is not None: - raise call.excinfo.value - else: - raise RuntimeError( - f"{call} has no exception data, an unknown error has occurred" - ) - - @pytest.hookimpl(tryfirst=True) - def pytest_internalerror(excinfo: pytest.ExceptionInfo[Any]): - raise excinfo.value