Skip to content

Commit

Permalink
rename type_test file to not be collected by pytest, import annotatio…
Browse files Browse the repository at this point in the history
…ns from future in _suppress

Also fix ruff warning from sections in pyproject
  • Loading branch information
jakkdl committed Apr 15, 2024
1 parent 0fdf1ea commit 859b913
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ version_scheme = "post-release"
local_scheme = "dirty-tag"
write_to = "src/exceptiongroup/_version.py"

[tool.ruff]
[tool.ruff.lint]
select = [
"E", "F", "W", # default flake-8
"I", # isort
Expand All @@ -55,11 +55,11 @@ select = [
"UP", # pyupgrade
]

[tool.ruff.pyupgrade]
[tool.ruff.lint.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
keep-runtime-typing = true

[tool.ruff.isort]
[tool.ruff.lint.isort]
known-first-party = ["exceptiongroup"]

[tool.pytest.ini_options]
Expand Down
2 changes: 2 additions & 0 deletions src/exceptiongroup/_suppress.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import sys
from contextlib import AbstractContextManager
from types import TracebackType
Expand Down
2 changes: 1 addition & 1 deletion tests/type_test.py → tests/check_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
assert_type(c, ExceptionGroup[ValueError])

# expected type error when passing a BaseException to ExceptionGroup
ExceptionGroup("", (KeyboardInterrupt(),)) # type: ignore
ExceptionGroup("", (KeyboardInterrupt(),)) # type: ignore[type-var]


# code snippets from the README
Expand Down

0 comments on commit 859b913

Please sign in to comment.