Skip to content

CI: Unpin pytest #35272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from 3 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: 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-minimum_versions.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
- 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 @@ -51,7 +51,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
4 changes: 2 additions & 2 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 @@ -2882,7 +2882,7 @@ def convert_rows_list_to_csv_str(rows_list: List[str]):

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

Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/arithmetic/test_numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,8 @@ class TestMultiplicationDivision:
pytest.param(
pd.Index,
marks=pytest.mark.xfail(
reason="Index.__div__ always raises", raises=TypeError
# https://github.com/pytest-dev/pytest/issues/7488
reason="Index.__div__ always raises", raises=TypeError # type: ignore # noqa
),
),
pd.Series,
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/arrays/interval/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def constructor(request):
(Timestamp("2018-01-01"), Timedelta("1 day")),
(0, 1),
],
ids=lambda x: type(x[0]).__name__,
ids=lambda x: type(x[0]).__name__, # type: ignore
)
def start_shift(request):
"""
Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/extension/test_sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@ def test_astype_str(self, data):
expected = pd.Series([str(x) for x in data[:5]], dtype=expected_dtype)
self.assert_series_equal(result, expected)

@pytest.mark.xfail(raises=TypeError, reason="no sparse StringDtype")
# https://github.com/pytest-dev/pytest/issues/7488
@pytest.mark.xfail(raises=TypeError, reason="no sparse StringDtype") # type: ignore
def test_astype_string(self, data):
super().test_astype_string(data)

Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/frame/methods/test_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ def test_diff_axis(self):

@pytest.mark.xfail(
reason="GH#32995 needs to operate column-wise or do inference",
raises=AssertionError,
# https://github.com/pytest-dev/pytest/issues/7488
raises=AssertionError, # type: ignore
)
def test_diff_period(self):
# GH#32995 Don't pass an incorrect axis
Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/plotting/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2696,7 +2696,8 @@ def test_errorbar_plot(self):
with pytest.raises((ValueError, TypeError)):
df.plot(yerr=df_err)

@pytest.mark.xfail(reason="Iterator is consumed", raises=ValueError)
# https://github.com/pytest-dev/pytest/issues/7488
@pytest.mark.xfail(reason="Iterator is consumed", raises=ValueError) # type: ignore
@pytest.mark.slow
def test_errorbar_plot_iterator(self):
with warnings.catch_warnings():
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/scalar/interval/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
(Timestamp("2018-01-01"), Timedelta("1 day")),
(0, 1),
],
ids=lambda x: type(x[0]).__name__,
ids=lambda x: type(x[0]).__name__, # type: ignore
)
def start_shift(request):
"""
Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/scalar/timedelta/test_arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,8 @@ def test_td_div_numeric_scalar(self):
marks=pytest.mark.xfail(
# Works on numpy dev only in python 3.9
_is_numpy_dev and not compat.PY39,
raises=RuntimeWarning,
# https://github.com/pytest-dev/pytest/issues/7488
raises=RuntimeWarning, # type: ignore
reason="https://github.com/pandas-dev/pandas/issues/31992",
),
),
Expand Down
6 changes: 4 additions & 2 deletions pandas/tests/series/test_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,15 +333,17 @@ def test_reversed_xor_with_index_returns_index(self):
ops.rand_,
marks=pytest.mark.xfail(
reason="GH#22092 Index __and__ returns Index intersection",
raises=AssertionError,
# https://github.com/pytest-dev/pytest/issues/7488
raises=AssertionError, # type: ignore
strict=True,
),
),
pytest.param(
ops.ror_,
marks=pytest.mark.xfail(
reason="GH#22092 Index __or__ returns Index union",
raises=AssertionError,
# https://github.com/pytest-dev/pytest/issues/7488
raises=AssertionError, # type: ignore
strict=True,
),
),
Expand Down
9 changes: 4 additions & 5 deletions pandas/util/_test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def test_foo():

import numpy as np
import pytest
from _pytest.mark import MarkDecorator

from pandas.compat import is_platform_32bit, is_platform_windows
from pandas.compat._optional import import_optional_dependency
Expand Down Expand Up @@ -197,13 +198,11 @@ 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:
ver_str: str, *args, reason: Optional[str] = None
) -> MarkDecorator:
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