Skip to content

Commit 5b18182

Browse files
Add conftest to allow for wider range of Protobuf version exceptions (#72)
2 parents 2d46b61 + 5b05130 commit 5b18182

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ disable = [
144144
]
145145

146146
[tool.pytest.ini_options]
147-
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"
147+
addopts = "-W=all -Wdefault::DeprecationWarning -Wdefault::PendingDeprecationWarning -vv"
148148
testpaths = ["tests", "src"]
149149
asyncio_mode = "auto"
150150
asyncio_default_fixture_loop_scope = "function"

tests/conftest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# License: MIT
2+
# Copyright © 2025 Frequenz Energy-as-a-Service GmbH
3+
4+
"""Show Protobuf version warning during tests, but don't treat as error."""
5+
6+
import warnings
7+
8+
warnings.filterwarnings(
9+
"once",
10+
message=r"Protobuf gencode version 5\..*exactly one major version older.*",
11+
category=UserWarning,
12+
)

0 commit comments

Comments
 (0)