diff --git a/flake8_encodings/__init__.py b/flake8_encodings/__init__.py index 8c20f54..f3a7817 100644 --- a/flake8_encodings/__init__.py +++ b/flake8_encodings/__init__.py @@ -186,7 +186,7 @@ def visit_Call(self, node: ast.Call) -> None: # noqa: D102 self.generic_visit(node) -class ClassVisitor(Visitor): +class ClassVisitor(Visitor): # pragma: no cover (py313+) """ AST visitor to identify incorrect use of encodings, with support for :class:`pathlib.Path` and :class:`configparser.ConfigParser`. @@ -361,7 +361,7 @@ def __init__(self, tree: ast.AST, filename: PathLike): def run(self) -> Iterator[Tuple[int, int, str, Type["Plugin"]]]: # noqa: D102 - try: + try: # pragma: no cover (py313+) # 3rd party import jedi @@ -388,7 +388,7 @@ def run(self) -> Iterator[Tuple[int, int, str, Type["Plugin"]]]: # noqa: D102 yield line, col, msg, type(self) -def is_configparser_read(class_name: str, method_name: str) -> bool: +def is_configparser_read(class_name: str, method_name: str) -> bool: # pragma: no cover (py313+) """ Returns :py:obj:`True` if method is :meth:`configparser.ConfigParser.read` or :meth:`configparser.RawConfigParser.read`. @@ -408,7 +408,7 @@ def is_configparser_read(class_name: str, method_name: str) -> bool: return True -def is_pathlib_method(class_name: str, method_name: str) -> bool: +def is_pathlib_method(class_name: str, method_name: str) -> bool: # pragma: no cover (py313+) """ Returns :py:obj:`True` if method is :meth:`pathlib.Path.open`, :meth:`read_text() ` or :meth:`write_text() `. @@ -428,7 +428,7 @@ def is_pathlib_method(class_name: str, method_name: str) -> bool: return True -def get_inferred_types(jedi_script: "Script", node: ast.Call) -> List[str]: +def get_inferred_types(jedi_script: "Script", node: ast.Call) -> List[str]: # pragma: no cover (py313+) """ Returns a list of types inferred by ``jedi`` for the given call node. diff --git a/repo_helper.yml b/repo_helper.yml index ca826fb..3ca808f 100644 --- a/repo_helper.yml +++ b/repo_helper.yml @@ -68,6 +68,7 @@ extras_require: tox_unmanaged: - testenv + - testenv:py313-dev exclude_files: - contributing diff --git a/tox.ini b/tox.ini index 8f6b051..4e09abb 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,6 @@ # * tox # * envlists # * testenv:.package -# * testenv:py313-dev # * testenv:py312-dev # * testenv:py312 # * testenv:docs @@ -65,11 +64,6 @@ setenv = PYTHONDEVMODE=1 PIP_DISABLE_PIP_VERSION_CHECK=1 -[testenv:py313-dev] -setenv = - PYTHONDEVMODE=1 - PIP_DISABLE_PIP_VERSION_CHECK=1 - [testenv:py312] setenv = PYTHONDEVMODE=1 @@ -231,6 +225,15 @@ filterwarnings = error ignore:can't resolve package from __spec__ or __package__, falling back on __name__ and __path__:ImportWarning +[testenv:py313-dev] +setenv = + PYTHONDEVMODE=1 + PIP_DISABLE_PIP_VERSION_CHECK=1 +commands = + python --version + python -m pip uninstall jedi -y + python -m pytest --cov=flake8_encodings -r aR tests/ --cov-append {posargs} + [testenv] setenv = PYTHONDEVMODE=1