Skip to content

Commit fd68238

Browse files
committed
Fix warning filtering in pytest configuration
Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 7802605 commit fd68238

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

pyproject.toml

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

146146
[tool.pytest.ini_options]
147-
addopts = "-W=all -Werror -Wdefault::DeprecationWarning -Wdefault::PendingDeprecationWarning '-Wdefault:Protobuf gencode version 5.27.2 is exactly one major version older than the runtime version:UserWarning' -vv"
147+
addopts = "-vv"
148+
filterwarnings = [
149+
"error",
150+
"once::DeprecationWarning",
151+
"once::PendingDeprecationWarning",
152+
# We ignore warnings about protobuf gencode version being one version older
153+
# than the current version, as this is supported by protobuf, and we expect to
154+
# have such cases. If we go too far, we will get a proper error anyways.
155+
# We use a raw string (single quotes) to avoid the need to escape special
156+
# characters as this is a regex.
157+
'ignore:Protobuf gencode version .*exactly one major version older.*:UserWarning',
158+
]
148159
testpaths = ["tests", "src"]
149160
asyncio_mode = "auto"
150161
asyncio_default_fixture_loop_scope = "function"

0 commit comments

Comments
 (0)