Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/pypi_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ jobs:
- uses: pypa/[email protected]
with:
only: ${{ matrix.only }}
env:
CIBW_TEST_REQUIRES_WINDOWS: "pytest^<9.0"

- name: Upload wheels as workflow artifacts
uses: actions/upload-artifact@v5
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ skip = [
# This is the bare minimum needed to run the test suite. Pulling in the full
# test_requirements.txt would download a bunch of other packages not necessary
# here and would slow down the testing step a fair bit.
test-requires = ["pytest>=6.1.1,<9.0"]
test-requires = ["pytest>=7"]
test-command = 'pytest {project} -k "not incompatible_with_mypyc"'
test-extras = ["d"," jupyter"]
# Skip trying to test arm64 builds on Intel Macs. (so cross-compilation doesn't
Expand Down
2 changes: 1 addition & 1 deletion test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
coverage >= 5.3
pre-commit
pytest >= 6.1.1, <9.0
pytest >= 7
pytest-xdist >= 3.0.2
pytest-cov >= 4.1.0
tox
18 changes: 3 additions & 15 deletions tests/optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,7 @@
from typing import TYPE_CHECKING

import pytest

try:
from pytest import StashKey
except ImportError:
# pytest < 7
#
# "isort: skip" is needed or it moves the "type: ignore" to the following line
# because of the line length, and then mypy complains.
# Of course, adding the "isort: skip" means that
# flake8-bugbear then also complains about the line length,
# so we *also* need a "noqa" comment for good measure :)
from _pytest.store import ( # type: ignore[import-not-found, no-redef] # isort: skip # noqa: B950
StoreKey as StashKey,
)
from pytest import StashKey

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -73,7 +60,8 @@ def pytest_configure(config: "Config") -> None:
if isinstance(ot_ini, str):
ot_ini = ot_ini.strip().split("\n")
marker_re = re.compile(r"^\s*(?P<no>no_)?(?P<marker>\w+)(:\s*(?P<description>.*))?")
for ot in ot_ini:
# getattr shim here is so that we support both pytest>=9 and pytest<9
for ot in getattr(ot_ini, "value", ot_ini):
m = marker_re.match(ot)
if not m:
raise ValueError(f"{ot!r} doesn't match pytest marker syntax")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_black.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ def test_get_features_used_for_future_flags(self) -> None:
("a = 1 + 2\nfrom something import annotations", set()),
("from __future__ import x, y", set()),
]:
with self.subTest(src=src, features=features):
with self.subTest(src=src, features=sorted(f.value for f in features)):
node = black.lib2to3_parse(src)
future_imports = black.get_future_imports(node)
self.assertEqual(
Expand Down