Skip to content

Commit 3b1d4f1

Browse files
CI: Unpin pytest (#35272)
1 parent 08b3ee8 commit 3b1d4f1

20 files changed

+33
-35
lines changed

ci/deps/azure-36-32bit.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ dependencies:
2323
- pip
2424
- pip:
2525
- cython>=0.29.16
26-
- pytest>=5.0.1,<6.0.0rc0
26+
- pytest>=5.0.1

ci/deps/azure-36-locale.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
# tools
99
- cython>=0.29.16
10-
- pytest>=5.0.1,<6.0.0rc0
10+
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- pytest-asyncio
1313
- hypothesis>=3.58.0

ci/deps/azure-36-locale_slow.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
# tools
99
- cython>=0.29.16
10-
- pytest>=5.0.1,<6.0.0rc0
10+
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313
- pytest-azurepipelines

ci/deps/azure-36-slow.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
# tools
99
- cython>=0.29.16
10-
- pytest>=5.0.1,<6.0.0rc0
10+
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313

ci/deps/azure-37-locale.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66

77
# tools
88
- cython>=0.29.16
9-
- pytest>=5.0.1,<6.0.0rc0
9+
- pytest>=5.0.1
1010
- pytest-xdist>=1.21
1111
- pytest-asyncio
1212
- hypothesis>=3.58.0

ci/deps/azure-37-numpydev.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies:
55
- python=3.7.*
66

77
# tools
8-
- pytest>=5.0.1,<6.0.0rc0
8+
- pytest>=5.0.1
99
- pytest-xdist>=1.21
1010
- hypothesis>=3.58.0
1111
- pytest-azurepipelines

ci/deps/azure-macos-36.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies:
55
- python=3.6.*
66

77
# tools
8-
- pytest>=5.0.1,<6.0.0rc0
8+
- pytest>=5.0.1
99
- pytest-xdist>=1.21
1010
- hypothesis>=3.58.0
1111
- pytest-azurepipelines

ci/deps/azure-windows-36.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
# tools
99
- cython>=0.29.16
10-
- pytest>=5.0.1,<6.0.0rc0
10+
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313
- pytest-azurepipelines

ci/deps/azure-windows-37.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
# tools
99
- cython>=0.29.16
10-
- pytest>=5.0.1,<6.0.0rc0
10+
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313
- pytest-azurepipelines

ci/deps/travis-36-cov.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
# tools
99
- cython>=0.29.16
10-
- pytest>=5.0.1,<6.0.0rc0
10+
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313
- pytest-cov # this is only needed in the coverage build

ci/deps/travis-36-locale.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
# tools
99
- cython>=0.29.16
10-
- pytest>=5.0.1,<6.0.0rc0
10+
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313

ci/deps/travis-37-arm64.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
# tools
99
- cython>=0.29.13
10-
- pytest>=5.0.1,<6.0.0rc0
10+
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313

ci/deps/travis-37.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
# tools
99
- cython>=0.29.16
10-
- pytest>=5.0.1,<6.0.0rc0
10+
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313

ci/deps/travis-38.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77

88
# tools
99
- cython>=0.29.16
10-
- pytest>=5.0.1,<6.0.0rc0
10+
- pytest>=5.0.1
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313

environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ dependencies:
5252
- botocore>=1.11
5353
- hypothesis>=3.82
5454
- moto # mock S3
55-
- pytest>=5.0.1,<6.0.0rc0
55+
- pytest>=5.0.1
5656
- pytest-cov
5757
- pytest-xdist>=1.21
5858
- pytest-asyncio

pandas/_testing.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from shutil import rmtree
1010
import string
1111
import tempfile
12-
from typing import Any, Callable, List, Optional, Type, Union, cast
12+
from typing import Any, Callable, ContextManager, List, Optional, Type, Union, cast
1313
import warnings
1414
import zipfile
1515

@@ -2880,9 +2880,7 @@ def convert_rows_list_to_csv_str(rows_list: List[str]):
28802880
return expected
28812881

28822882

2883-
def external_error_raised(
2884-
expected_exception: Type[Exception],
2885-
) -> Callable[[Type[Exception], None], None]:
2883+
def external_error_raised(expected_exception: Type[Exception],) -> ContextManager:
28862884
"""
28872885
Helper function to mark pytest.raises that have an external error message.
28882886

pandas/tests/groupby/test_categorical.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -1294,9 +1294,7 @@ def test_get_nonexistent_category():
12941294
)
12951295

12961296

1297-
def test_series_groupby_on_2_categoricals_unobserved(
1298-
reduction_func: str, observed: bool, request
1299-
):
1297+
def test_series_groupby_on_2_categoricals_unobserved(reduction_func, observed, request):
13001298
# GH 17605
13011299
if reduction_func == "ngroup":
13021300
pytest.skip("ngroup is not truly a reduction")
@@ -1326,7 +1324,7 @@ def test_series_groupby_on_2_categoricals_unobserved(
13261324

13271325

13281326
def test_series_groupby_on_2_categoricals_unobserved_zeroes_or_nans(
1329-
reduction_func: str, request
1327+
reduction_func, request
13301328
):
13311329
# GH 17605
13321330
# Tests whether the unobserved categories in the result contain 0 or NaN
@@ -1374,7 +1372,7 @@ def test_series_groupby_on_2_categoricals_unobserved_zeroes_or_nans(
13741372
assert np.issubdtype(result.dtype, np.integer)
13751373

13761374

1377-
def test_dataframe_groupby_on_2_categoricals_when_observed_is_true(reduction_func: str):
1375+
def test_dataframe_groupby_on_2_categoricals_when_observed_is_true(reduction_func):
13781376
# GH 23865
13791377
# GH 27075
13801378
# Ensure that df.groupby, when 'by' is two pd.Categorical variables,
@@ -1402,7 +1400,7 @@ def test_dataframe_groupby_on_2_categoricals_when_observed_is_true(reduction_fun
14021400

14031401
@pytest.mark.parametrize("observed", [False, None])
14041402
def test_dataframe_groupby_on_2_categoricals_when_observed_is_false(
1405-
reduction_func: str, observed: bool, request
1403+
reduction_func, observed, request
14061404
):
14071405
# GH 23865
14081406
# GH 27075

pandas/util/_test_decorators.py

+10-8
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ def _skip_if_no_scipy() -> bool:
120120
)
121121

122122

123-
def skip_if_installed(package: str) -> Callable:
123+
# TODO: return type, _pytest.mark.structures.MarkDecorator is not public
124+
# https://github.com/pytest-dev/pytest/issues/7469
125+
def skip_if_installed(package: str):
124126
"""
125127
Skip a test if a package is installed.
126128
@@ -134,7 +136,9 @@ def skip_if_installed(package: str) -> Callable:
134136
)
135137

136138

137-
def skip_if_no(package: str, min_version: Optional[str] = None) -> Callable:
139+
# TODO: return type, _pytest.mark.structures.MarkDecorator is not public
140+
# https://github.com/pytest-dev/pytest/issues/7469
141+
def skip_if_no(package: str, min_version: Optional[str] = None):
138142
"""
139143
Generic function to help skip tests when required packages are not
140144
present on the testing system.
@@ -196,14 +200,12 @@ def skip_if_no(package: str, min_version: Optional[str] = None) -> Callable:
196200
)
197201

198202

199-
def skip_if_np_lt(
200-
ver_str: str, reason: Optional[str] = None, *args, **kwds
201-
) -> Callable:
203+
# TODO: return type, _pytest.mark.structures.MarkDecorator is not public
204+
# https://github.com/pytest-dev/pytest/issues/7469
205+
def skip_if_np_lt(ver_str: str, *args, reason: Optional[str] = None):
202206
if reason is None:
203207
reason = f"NumPy {ver_str} or greater required"
204-
return pytest.mark.skipif(
205-
_np_version < LooseVersion(ver_str), reason=reason, *args, **kwds
206-
)
208+
return pytest.mark.skipif(_np_version < LooseVersion(ver_str), *args, reason=reason)
207209

208210

209211
def parametrize_fixture_doc(*args):

requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ boto3
3232
botocore>=1.11
3333
hypothesis>=3.82
3434
moto
35-
pytest>=5.0.1,<6.0.0rc0
35+
pytest>=5.0.1
3636
pytest-cov
3737
pytest-xdist>=1.21
3838
pytest-asyncio

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ known_dtypes = pandas.core.dtypes
105105
known_post_core = pandas.tseries,pandas.io,pandas.plotting
106106
sections = FUTURE,STDLIB,THIRDPARTY,PRE_LIBS,PRE_CORE,DTYPES,FIRSTPARTY,POST_CORE,LOCALFOLDER
107107
known_first_party = pandas
108-
known_third_party = _pytest,announce,dateutil,docutils,flake8,git,hypothesis,jinja2,lxml,matplotlib,numpy,numpydoc,pkg_resources,pyarrow,pytest,pytz,requests,scipy,setuptools,sphinx,sqlalchemy,validate_docstrings,validate_unwanted_patterns,yaml,odf
108+
known_third_party = announce,dateutil,docutils,flake8,git,hypothesis,jinja2,lxml,matplotlib,numpy,numpydoc,pkg_resources,pyarrow,pytest,pytz,requests,scipy,setuptools,sphinx,sqlalchemy,validate_docstrings,validate_unwanted_patterns,yaml,odf
109109
multi_line_output = 3
110110
include_trailing_comma = True
111111
force_grid_wrap = 0

0 commit comments

Comments
 (0)