From e5b2cbd2ce9d29be3b3174bd64c55a5c8ed1293a Mon Sep 17 00:00:00 2001 From: Delgan Date: Wed, 10 Jan 2024 13:47:24 +0100 Subject: [PATCH] Treat all warnings as errors during tests This helps catching incorrect/deprecated API usage of third-party libraries and also potentials ressources not properly disposed during tests (for example, Pytest reports a warking internally if a file object wasn't closed). --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index c65fab0b..6b476a54 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,8 @@ strict = true [tool.pytest.ini_options] addopts = "-l" filterwarnings = [ + # By default all warnings are treated as errors. + 'error', # Mixing threads and "fork()" is deprecated, but we need to test it anyway. 'ignore:.*use of fork\(\) may lead to deadlocks in the child.*:DeprecationWarning', # The "dateutil" package used by "freezegun" relies on some deprecated APIs.