Skip to content

Commit

Permalink
CI: Unpin pytest (#35272)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjayhawkins authored Jul 29, 2020
1 parent 08b3ee8 commit 3b1d4f1
Show file tree
Hide file tree
Showing 20 changed files with 33 additions and 35 deletions.
2 changes: 1 addition & 1 deletion ci/deps/azure-36-32bit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ dependencies:
- pip
- pip:
- cython>=0.29.16
- pytest>=5.0.1,<6.0.0rc0
- pytest>=5.0.1
2 changes: 1 addition & 1 deletion ci/deps/azure-36-locale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:

# tools
- cython>=0.29.16
- pytest>=5.0.1,<6.0.0rc0
- pytest>=5.0.1
- pytest-xdist>=1.21
- pytest-asyncio
- hypothesis>=3.58.0
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/azure-36-locale_slow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:

# tools
- cython>=0.29.16
- pytest>=5.0.1,<6.0.0rc0
- pytest>=5.0.1
- pytest-xdist>=1.21
- hypothesis>=3.58.0
- pytest-azurepipelines
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/azure-36-slow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:

# tools
- cython>=0.29.16
- pytest>=5.0.1,<6.0.0rc0
- pytest>=5.0.1
- pytest-xdist>=1.21
- hypothesis>=3.58.0

Expand Down
2 changes: 1 addition & 1 deletion ci/deps/azure-37-locale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:

# tools
- cython>=0.29.16
- pytest>=5.0.1,<6.0.0rc0
- pytest>=5.0.1
- pytest-xdist>=1.21
- pytest-asyncio
- hypothesis>=3.58.0
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/azure-37-numpydev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependencies:
- python=3.7.*

# tools
- pytest>=5.0.1,<6.0.0rc0
- pytest>=5.0.1
- pytest-xdist>=1.21
- hypothesis>=3.58.0
- pytest-azurepipelines
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/azure-macos-36.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependencies:
- python=3.6.*

# tools
- pytest>=5.0.1,<6.0.0rc0
- pytest>=5.0.1
- pytest-xdist>=1.21
- hypothesis>=3.58.0
- pytest-azurepipelines
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/azure-windows-36.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:

# tools
- cython>=0.29.16
- pytest>=5.0.1,<6.0.0rc0
- pytest>=5.0.1
- pytest-xdist>=1.21
- hypothesis>=3.58.0
- pytest-azurepipelines
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/azure-windows-37.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:

# tools
- cython>=0.29.16
- pytest>=5.0.1,<6.0.0rc0
- pytest>=5.0.1
- pytest-xdist>=1.21
- hypothesis>=3.58.0
- pytest-azurepipelines
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/travis-36-cov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:

# tools
- cython>=0.29.16
- pytest>=5.0.1,<6.0.0rc0
- pytest>=5.0.1
- pytest-xdist>=1.21
- hypothesis>=3.58.0
- pytest-cov # this is only needed in the coverage build
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/travis-36-locale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:

# tools
- cython>=0.29.16
- pytest>=5.0.1,<6.0.0rc0
- pytest>=5.0.1
- pytest-xdist>=1.21
- hypothesis>=3.58.0

Expand Down
2 changes: 1 addition & 1 deletion ci/deps/travis-37-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:

# tools
- cython>=0.29.13
- pytest>=5.0.1,<6.0.0rc0
- pytest>=5.0.1
- pytest-xdist>=1.21
- hypothesis>=3.58.0

Expand Down
2 changes: 1 addition & 1 deletion ci/deps/travis-37.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:

# tools
- cython>=0.29.16
- pytest>=5.0.1,<6.0.0rc0
- pytest>=5.0.1
- pytest-xdist>=1.21
- hypothesis>=3.58.0

Expand Down
2 changes: 1 addition & 1 deletion ci/deps/travis-38.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:

# tools
- cython>=0.29.16
- pytest>=5.0.1,<6.0.0rc0
- pytest>=5.0.1
- pytest-xdist>=1.21
- hypothesis>=3.58.0

Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ dependencies:
- botocore>=1.11
- hypothesis>=3.82
- moto # mock S3
- pytest>=5.0.1,<6.0.0rc0
- pytest>=5.0.1
- pytest-cov
- pytest-xdist>=1.21
- pytest-asyncio
Expand Down
6 changes: 2 additions & 4 deletions pandas/_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from shutil import rmtree
import string
import tempfile
from typing import Any, Callable, List, Optional, Type, Union, cast
from typing import Any, Callable, ContextManager, List, Optional, Type, Union, cast
import warnings
import zipfile

Expand Down Expand Up @@ -2880,9 +2880,7 @@ def convert_rows_list_to_csv_str(rows_list: List[str]):
return expected


def external_error_raised(
expected_exception: Type[Exception],
) -> Callable[[Type[Exception], None], None]:
def external_error_raised(expected_exception: Type[Exception],) -> ContextManager:
"""
Helper function to mark pytest.raises that have an external error message.
Expand Down
10 changes: 4 additions & 6 deletions pandas/tests/groupby/test_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -1294,9 +1294,7 @@ def test_get_nonexistent_category():
)


def test_series_groupby_on_2_categoricals_unobserved(
reduction_func: str, observed: bool, request
):
def test_series_groupby_on_2_categoricals_unobserved(reduction_func, observed, request):
# GH 17605
if reduction_func == "ngroup":
pytest.skip("ngroup is not truly a reduction")
Expand Down Expand Up @@ -1326,7 +1324,7 @@ def test_series_groupby_on_2_categoricals_unobserved(


def test_series_groupby_on_2_categoricals_unobserved_zeroes_or_nans(
reduction_func: str, request
reduction_func, request
):
# GH 17605
# Tests whether the unobserved categories in the result contain 0 or NaN
Expand Down Expand Up @@ -1374,7 +1372,7 @@ def test_series_groupby_on_2_categoricals_unobserved_zeroes_or_nans(
assert np.issubdtype(result.dtype, np.integer)


def test_dataframe_groupby_on_2_categoricals_when_observed_is_true(reduction_func: str):
def test_dataframe_groupby_on_2_categoricals_when_observed_is_true(reduction_func):
# GH 23865
# GH 27075
# Ensure that df.groupby, when 'by' is two pd.Categorical variables,
Expand Down Expand Up @@ -1402,7 +1400,7 @@ def test_dataframe_groupby_on_2_categoricals_when_observed_is_true(reduction_fun

@pytest.mark.parametrize("observed", [False, None])
def test_dataframe_groupby_on_2_categoricals_when_observed_is_false(
reduction_func: str, observed: bool, request
reduction_func, observed, request
):
# GH 23865
# GH 27075
Expand Down
18 changes: 10 additions & 8 deletions pandas/util/_test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ def _skip_if_no_scipy() -> bool:
)


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


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


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


def parametrize_fixture_doc(*args):
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ boto3
botocore>=1.11
hypothesis>=3.82
moto
pytest>=5.0.1,<6.0.0rc0
pytest>=5.0.1
pytest-cov
pytest-xdist>=1.21
pytest-asyncio
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ known_dtypes = pandas.core.dtypes
known_post_core = pandas.tseries,pandas.io,pandas.plotting
sections = FUTURE,STDLIB,THIRDPARTY,PRE_LIBS,PRE_CORE,DTYPES,FIRSTPARTY,POST_CORE,LOCALFOLDER
known_first_party = pandas
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
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
multi_line_output = 3
include_trailing_comma = True
force_grid_wrap = 0
Expand Down

0 comments on commit 3b1d4f1

Please sign in to comment.