summaryrefslogtreecommitdiff
path: root/src/tox
diff options
context:
space:
mode:
Diffstat (limited to 'src/tox')
-rw-r--r--src/tox/config/cli/parser.py4
-rw-r--r--src/tox/config/loader/convert.py4
-rw-r--r--src/tox/pytest.py2
-rw-r--r--src/tox/report.py4
-rw-r--r--src/tox/tox_env/python/virtual_env/package/util.py6
5 files changed, 10 insertions, 10 deletions
diff --git a/src/tox/config/cli/parser.py b/src/tox/config/cli/parser.py
index aeee7f1f..6d7c44cd 100644
--- a/src/tox/config/cli/parser.py
+++ b/src/tox/config/cli/parser.py
@@ -203,11 +203,11 @@ class ToxParser(ArgumentParserWithEnvAndConfig):
excl.append((e_kwargs, arguments))
res_excl = prev_excl(**kwargs)
prev_add_arg = res_excl.add_argument
- res_excl.add_argument = add_argument # type: ignore[assignment]
+ res_excl.add_argument = add_argument # type: ignore[method-assign]
return res_excl
prev_excl = result.add_mutually_exclusive_group
- result.add_mutually_exclusive_group = add_mutually_exclusive_group # type: ignore[assignment]
+ result.add_mutually_exclusive_group = add_mutually_exclusive_group # type: ignore[method-assign]
excl: list[tuple[dict[str, Any], list[ArgumentArgs]]] = []
self._groups.append((args, kwargs, excl))
return result
diff --git a/src/tox/config/loader/convert.py b/src/tox/config/loader/convert.py
index b9259b05..900f1e21 100644
--- a/src/tox/config/loader/convert.py
+++ b/src/tox/config/loader/convert.py
@@ -71,13 +71,13 @@ class Convert(ABC, Generic[T]):
elif origin == Union: # handle Optional values
args: list[type[Any]] = of_type.__args__ # type: ignore[attr-defined]
none = type(None)
- if len(args) == 2 and none in args:
+ if len(args) == 2 and none in args: # type: ignore[comparison-overlap]
if isinstance(raw, str):
raw = raw.strip() # type: ignore[assignment]
if not raw:
result = None
else:
- new_type = next(i for i in args if i != none) # pragma: no cover # this will always find a element
+ new_type = next(i for i in args if i != none) # type: ignore # pragma: no cover
result = self.to(raw, new_type, factory)
elif origin in (Literal, type(Literal)):
choice = of_type.__args__ # type: ignore[attr-defined]
diff --git a/src/tox/pytest.py b/src/tox/pytest.py
index fb83721c..0bc9905b 100644
--- a/src/tox/pytest.py
+++ b/src/tox/pytest.py
@@ -394,7 +394,7 @@ class ToxRunOutcome:
except ImportError: # pragma: no cover # hard to test
match = re.match(pattern, text, flags)
if match is None:
- warnings.warn("install the re-assert PyPI package for bette error message", UserWarning)
+ warnings.warn("install the re-assert PyPI package for bette error message", UserWarning, stacklevel=1)
assert match
else:
assert Matches(pattern, flags=flags) == text
diff --git a/src/tox/report.py b/src/tox/report.py
index f8a57a78..70c1de97 100644
--- a/src/tox/report.py
+++ b/src/tox/report.py
@@ -41,11 +41,11 @@ class _LogThreadLocal(local):
self.parent_ident = current_thread().ident # type: ignore[attr-defined]
old_start(self)
- old_start, Thread.start = Thread.start, new_start # type: ignore[assignment]
+ old_start, Thread.start = Thread.start, new_start # type: ignore[method-assign]
try:
yield
finally:
- Thread.start = old_start # type: ignore[assignment]
+ Thread.start = old_start # type: ignore[method-assign]
@property
def name(self) -> str:
diff --git a/src/tox/tox_env/python/virtual_env/package/util.py b/src/tox/tox_env/python/virtual_env/package/util.py
index 603f93ed..039b6476 100644
--- a/src/tox/tox_env/python/virtual_env/package/util.py
+++ b/src/tox/tox_env/python/virtual_env/package/util.py
@@ -3,7 +3,7 @@ from __future__ import annotations
from copy import deepcopy
from typing import Optional, Set, cast
-from packaging.markers import Marker, Op, Value, Variable # type: ignore[attr-defined]
+from packaging.markers import Marker, Op, Variable # type: ignore[attr-defined]
from packaging.requirements import Requirement
@@ -72,7 +72,7 @@ def _extract_extra_markers(req: Requirement) -> tuple[Requirement, set[str | Non
return req, cast(Set[Optional[str]], extra_markers) or {None}
-def _get_extra(_marker: str | tuple[Variable, Op, Value]) -> str | None:
+def _get_extra(_marker: str | tuple[Variable, Op, Variable]) -> str | None:
if isinstance(_marker, tuple) and len(_marker) == 3 and _marker[0].value == "extra" and _marker[1].value == "==":
- return cast(str, _marker[2].value)
+ return _marker[2].value
return None