From 081aafc0d1b3f76e85fafeaafbe5c017829d177b Mon Sep 17 00:00:00 2001 From: bosd Date: Thu, 14 Aug 2025 14:41:18 +0200 Subject: [PATCH] Silence warnings A CryptographyDeprecationWarning originating from the pypdf dependency. This warning is suppressed by setting the PYTHONWARNINGS environment variable in the noxfile.py for the test session. This approach is used because filtering the warning via pytest.ini is not feasible due to the way the warning is raised. --- noxfile.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 6c502cfc..d93f5bb5 100644 --- a/noxfile.py +++ b/noxfile.py @@ -190,7 +190,20 @@ def tests(session: Session) -> None: *plot_requires, ) try: - session.run("coverage", "run", "--parallel", "-m", "pytest", *session.posargs) + session.run( + "coverage", + "run", + "--parallel", + "-m", + "pytest", + *session.posargs, + env={ + "PYTHONWARNINGS": ( + "ignore:ARC4 has been moved to" + " cryptography.hazmat.decrepit.ciphers.algorithms.ARC4" + ) + }, + ) finally: if session.interactive: session.notify("coverage", posargs=[])