Skip to content

Commit eedde30

Browse files
committed
test: simplify pytest imports
1 parent e5b41fc commit eedde30

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ adheres to [Semantic Versioning](https://semver.org/).
1111

1212
### :house: Internal
1313

14-
- Necessary code changes following dev dependency update: black
14+
- Necessary code changes following dev dependency update: black, pytest
1515
- Refactor a descriptor following PEP 487
1616
- Add tests for CPython 3.11
1717
- Use CPython 3.11 for misc. tests

tests/conftest.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
from itertools import chain, product
22
from pathlib import Path
3-
from typing import TYPE_CHECKING, Callable, Iterator, Tuple
3+
from typing import Callable, Iterator, List, Tuple
44

55
import pytest
66

7-
if TYPE_CHECKING:
8-
from typing import List
97

10-
# see https://github.com/pytest-dev/pytest/issues/7469
11-
# for pytest exporting from pytest and not _pytest
12-
from _pytest.config import Config
13-
from _pytest.config.argparsing import Parser
14-
from _pytest.nodes import Item
15-
16-
17-
def pytest_addoption(parser: "Parser") -> None:
8+
def pytest_addoption(parser: pytest.Parser) -> None:
189
parser.addoption(
1910
"--generate-integration-files",
2011
action="store_true",
@@ -23,7 +14,9 @@ def pytest_addoption(parser: "Parser") -> None:
2314
)
2415

2516

26-
def pytest_collection_modifyitems(config: "Config", items: "List[Item]") -> None:
17+
def pytest_collection_modifyitems(
18+
config: pytest.Config, items: List[pytest.Item]
19+
) -> None:
2720
root = Path(__file__).parent.parent
2821
for item in items:
2922
if item.fspath:

0 commit comments

Comments
 (0)