Skip to content

Commit

Permalink
Configure pytest to ignore known DeprecationWarnings (#233)
Browse files Browse the repository at this point in the history
Older starlette and pydantic syntax is currently supported, so these
warnings are known and expected.

There are still two `ResourceWarning`s from anyio left to address. These
are thrown due to unclosed `MemoryObjectReceiveStream` objects.

Co-authored-by: Stanislav Zmiev <zmievsa@gmail.com>
  • Loading branch information
kurtmckee and zmievsa authored Dec 12, 2024
1 parent 4d8fe9d commit 2f5a2b6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,21 @@ reportFunctionMemberAccess = false
reportCircularImports = true
reportInvalidTypeForm = false

[tool.pytest.ini_options]
filterwarnings = [
# Replace the word "all" with "error" after resolving `ResourceWarning`s from anyio.
"all",

# Older starlette syntax is currently supported.
"ignore:The `name` is not the first parameter anymore:DeprecationWarning:starlette.templating",
"ignore:The on_startup and on_shutdown parameters are deprecated:DeprecationWarning:starlette.routing",

# Older pydantic syntax is currently supported.
"ignore:Using extra keyword arguments on `Field` is deprecated:DeprecationWarning:pydantic.fields",
"ignore:Pydantic V1 style `@root_validator` validators are deprecated:pydantic.PydanticDeprecatedSince20",
"ignore:Pydantic V1 style `@validator` validators are deprecated:pydantic.PydanticDeprecatedSince20",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

0 comments on commit 2f5a2b6

Please sign in to comment.