|
1 |
| -import sys |
2 | 1 | from contextlib import contextmanager
|
3 |
| -from pathlib import Path |
4 |
| -from types import MappingProxyType |
5 |
| -from typing import Callable, ContextManager, Iterator, Optional |
6 |
| - |
7 |
| -import pytest |
8 |
| -from _pytest.config import Config |
9 |
| -from py import path as pypath |
10 |
| -from typing_extensions import Final |
| 2 | +from typing import Callable, ContextManager, Iterator |
11 | 3 |
|
12 | 4 | from classes._typeclass import _TypeClass # noqa: WPS450
|
13 | 5 |
|
14 |
| -PYTHON_VERSION: Final = (sys.version_info.major, sys.version_info.minor) |
15 |
| -ENABLE_SINCE: Final = MappingProxyType({ |
16 |
| - (3, 8): frozenset(( |
17 |
| - Path('docs/pages/concept.rst'), |
18 |
| - )), |
19 |
| -}) |
20 |
| -PATHS_TO_IGNORE_NOW: Final = frozenset( |
21 |
| - path.absolute() |
22 |
| - for since_python, to_ignore in ENABLE_SINCE.items() |
23 |
| - for path in to_ignore |
24 |
| - if PYTHON_VERSION < since_python |
25 |
| -) |
26 |
| - |
27 |
| - |
28 |
| -def pytest_ignore_collect( |
29 |
| - path: pypath.local, |
30 |
| - config: Config, |
31 |
| -) -> Optional[bool]: |
32 |
| - """ |
33 |
| - Returns ``True`` to prevent considering this path for collection. |
34 |
| -
|
35 |
| - This hook is consulted for all files and directories prior to calling |
36 |
| - more specific hooks. Stops at first non-None result. |
37 |
| - """ |
38 |
| - return Path(path) in PATHS_TO_IGNORE_NOW |
39 |
| - |
40 | 6 |
|
41 | 7 | @pytest.fixture(scope='session')
|
42 | 8 | def clear_cache() -> Callable[[_TypeClass], ContextManager]:
|
|
0 commit comments