aboutsummaryrefslogtreecommitdiffstats
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2025-08-16 08:43:11 -0400
committerEugene Triguba <hello@eugenetriguba.com>2025-08-16 08:43:11 -0400
commit837b9b8f8ba4c395ea6379ac243adcd7a5ac4c92 (patch)
tree8d367b1f0cfb2c29060d0a312be9f0aa32590c7e /tests/conftest.py
parentRemove -x for run tests (diff)
downloadconfig-file-837b9b8f8ba4c395ea6379ac243adcd7a5ac4c92.zip
Fix config file path subclasses in 3.13
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 9392368..81f2c0b 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,5 +1,5 @@
from pathlib import Path
-from typing import Callable, Tuple, Type, Union
+from typing import Callable, Tuple, Union
import pytest
@@ -90,7 +90,7 @@ def template_original_file() -> Callable[[Path], Path]:
@pytest.fixture
def template_and_parser(
template_file: Callable[[str, str], Path]
-) -> Callable[[str, str], Tuple[Path, Type[AbstractParser]]]:
+) -> Callable[[str, str], Tuple[Path, AbstractParser]]:
"""
Retrieve the parser and test template for a particular
supported file type.
@@ -107,15 +107,15 @@ def template_and_parser(
def func(
file_type: str, template_name: str = "default"
- ) -> Tuple[Path, Type[AbstractParser]]:
+ ) -> Tuple[Path, AbstractParser]:
test_file = template_file(file_type, template_name)
- return test_file, ConfigFilePath(test_file).parser
+ return test_file, ConfigFilePath(test_file).file_parser
return func
@pytest.fixture
-def templated_parser(template_and_parser) -> Callable[[str, str], Type[AbstractParser]]:
+def templated_parser(template_and_parser) -> Callable[[str, str], AbstractParser]:
"""
Retrieve a parser for a particular supported file type with
a test template already read into it. Small helper around
@@ -131,7 +131,7 @@ def templated_parser(template_and_parser) -> Callable[[str, str], Type[AbstractP
read in.
"""
- def func(file_type: str, template_name: str = "default") -> Type[AbstractParser]:
+ def func(file_type: str, template_name: str = "default") -> AbstractParser:
return template_and_parser(file_type, template_name)[1]
return func