From 5392044eae85c03bb6a30208e4dcf9f1de7c0160 Mon Sep 17 00:00:00 2001 From: Flora Date: Tue, 13 May 2025 12:35:37 +0200 Subject: [PATCH 1/2] Add conftest to allow for wider range of Protobuf version exceptions Signed-off-by: Flora --- pyproject.toml | 2 +- tests/conftest.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 tests/conftest.py diff --git a/pyproject.toml b/pyproject.toml index 2d0dc841..8be5a8ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -144,7 +144,7 @@ disable = [ ] [tool.pytest.ini_options] -addopts = "-W=all -Werror -Wdefault::DeprecationWarning -Wdefault::PendingDeprecationWarning '-Wdefault:Protobuf gencode version 5.29.0 is exactly one major version older than the runtime version:UserWarning' -vv" +addopts = "-W=all -Wdefault::DeprecationWarning -Wdefault::PendingDeprecationWarning -vv" testpaths = ["tests", "src"] asyncio_mode = "auto" asyncio_default_fixture_loop_scope = "function" diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 00000000..877b5b13 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,12 @@ +# License: MIT +# Copyright © 2025 Frequenz Energy-as-a-Service GmbH + +"""Show Protobuf version warning during tests, but don't treat as error.""" + +import warnings + +warnings.filterwarnings( + "default", + message=r"Protobuf gencode version 5\..*exactly one major version older.*", + category=UserWarning, +) From 5b05130d3cc6dfb3d10ac60f8add47b51a9a5562 Mon Sep 17 00:00:00 2001 From: flora-hofmann-frequenz <88315331+flora-hofmann-frequenz@users.noreply.github.com> Date: Tue, 13 May 2025 14:15:54 +0200 Subject: [PATCH 2/2] Update tests/conftest.py Co-authored-by: Leandro Lucarella Signed-off-by: flora-hofmann-frequenz <88315331+flora-hofmann-frequenz@users.noreply.github.com> --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 877b5b13..4e2963af 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -6,7 +6,7 @@ import warnings warnings.filterwarnings( - "default", + "once", message=r"Protobuf gencode version 5\..*exactly one major version older.*", category=UserWarning, )