Skip to content

Commit 702909d

Browse files
authored
Don't skip tests when on a mypy branch (#10129)
For some reason, my local was skipping tests when on a branch named `mypy`, or at least something was setting a `mypy` keyword on the test items. This changes the check check whether the test has the `mypy` marker set, which is more precise than just looking at the keywords.
1 parent 6c89f97 commit 702909d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

conftest.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ def pytest_runtest_setup(item):
2222
pytest.skip(
2323
"set --run-network-tests to run test requiring an internet connection"
2424
)
25-
if "mypy" in item.keywords and not item.config.getoption("--run-mypy"):
25+
if any("mypy" in m.name for m in item.own_markers) and not item.config.getoption(
26+
"--run-mypy"
27+
):
2628
pytest.skip("set --run-mypy option to run mypy tests")
2729

2830

0 commit comments

Comments
 (0)