From 33c31a9cab281d5573628502be93ebdf68f1ffdd Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Fri, 21 Mar 2025 10:39:40 +0100 Subject: [PATCH] Move pytest config into pyproject.toml. --- pyproject.toml | 14 +++++++++++++- pytest.ini | 12 ------------ requirements-devenv.txt | 3 ++- requirements-testing.txt | 3 ++- 4 files changed, 17 insertions(+), 15 deletions(-) delete mode 100644 pytest.ini diff --git a/pyproject.toml b/pyproject.toml index 7823c17a7e..8ed369199d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,4 +20,16 @@ omit = [ [tool.coverage.report] exclude_also = [ "if TYPE_CHECKING:", -] \ No newline at end of file +] + +[tool.pytest.ini_options] +addopts = "-vvv -rfEs -s --durations=5 --cov=./sentry_sdk --cov-branch --cov-report= --tb=short --junitxml=.junitxml" +asyncio_mode = "strict" +asyncio_default_fixture_loop_scope = "function" +markers = [ + "tests_internal_exceptions: Handle internal exceptions just as the SDK does, to test it. (Otherwise internal exceptions are recorded and reraised.)", +] + +[tool.pytest-watch] +verbose = true +nobeep = true diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 7edd6127b9..0000000000 --- a/pytest.ini +++ /dev/null @@ -1,12 +0,0 @@ -[pytest] -addopts = -vvv -rfEs -s --durations=5 --cov=./sentry_sdk --cov-branch --cov-report= --tb=short --junitxml=.junitxml -asyncio_mode = strict -asyncio_default_fixture_loop_scope = function -markers = - tests_internal_exceptions: Handle internal exceptions just as the SDK does, to test it. (Otherwise internal exceptions are recorded and reraised.) - -[pytest-watch] -verbose = True -nobeep = True -; Enable this to drop into pdb on errors -; pdb = True diff --git a/requirements-devenv.txt b/requirements-devenv.txt index c0fa5cf245..e5be6c7d77 100644 --- a/requirements-devenv.txt +++ b/requirements-devenv.txt @@ -1,5 +1,6 @@ -r requirements-linting.txt -r requirements-testing.txt mockupdb # required by `pymongo` tests that are enabled by `pymongo` from linter requirements -pytest +pytest>=6.0.0 +tomli;python_version<"3.11" # Only needed for pytest on Python < 3.11 pytest-asyncio diff --git a/requirements-testing.txt b/requirements-testing.txt index cbc515eec2..221863f4ab 100644 --- a/requirements-testing.txt +++ b/requirements-testing.txt @@ -1,5 +1,6 @@ pip -pytest +pytest>=6.0.0 +tomli;python_version<"3.11" # Only needed for pytest on Python < 3.11 pytest-cov pytest-forked pytest-localserver