From e0e4ab48c8f32be9eecc7fcda34886cb5941fe26 Mon Sep 17 00:00:00 2001 From: "David A. Ramos" Date: Tue, 25 Oct 2022 17:31:05 -0700 Subject: [PATCH] Add `py` package as explicit dev dependency It appears that this was previously a transitive dependency of one of the other packages installed in the tox environment, but is no longer (most likely due to the package being deprecated). This plugin only depends on the package for mypy typing and for backward compatibility with versions of PyTest prior to 7.0. --- setup.cfg | 1 + src/pytest_unflakable/_plugin.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 614fc9a..bbd7f5a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,6 +45,7 @@ dev = flake8 flake8-quotes mypy + py>=1.9.0 pytest-xdist>=2.0.0 requests-mock[fixture] types-requests diff --git a/src/pytest_unflakable/_plugin.py b/src/pytest_unflakable/_plugin.py index 62bda26..d113edb 100644 --- a/src/pytest_unflakable/_plugin.py +++ b/src/pytest_unflakable/_plugin.py @@ -10,7 +10,6 @@ import logging import pprint -import py import pytest import _pytest import sys @@ -27,6 +26,7 @@ ) if TYPE_CHECKING: + import py from typing import Literal # Most of these types aren't defined or exported in older versions of pytest, but we only need @@ -35,15 +35,16 @@ CallPhase = Literal['setup', 'call', 'teardown'] CollectReport = pytest.CollectReport Config = pytest.Config + PathCompat = Union[py.path.local, Path] else: CallInfo = object CallPhase = str CollectReport = object Config = object + PathCompat = object TestPathAndName = Tuple[str, Tuple[str, ...]] QuarantinedTests = Set[TestPathAndName] -PathCompat = Union[py.path.local, Path] class QuarantineMode(Enum):