Skip to content

Failures with pytest 6.0.0rc1 #35261

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

Closed
TomAugspurger opened this issue Jul 13, 2020 · 2 comments · Fixed by #35272
Closed

Failures with pytest 6.0.0rc1 #35261

TomAugspurger opened this issue Jul 13, 2020 · 2 comments · Fixed by #35272
Labels
CI Continuous Integration Testing pandas testing functions or related to the test suite

Comments

@TomAugspurger
Copy link
Contributor

https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=39140&view=logs&j=a3a13ea8-7cf0-5bdb-71bb-6ac8830ae35c&t=add65f64-6c25-5783-8fd6-d9aa1b63d9d4

=================================== FAILURES ===================================
____ TestStringMethods.test_api_per_method[index-empty0-get_dummies-object] ____
[gw0] linux -- Python 3.7.6 /home/vsts/miniconda3/envs/pandas-dev/bin/python

        copy=False,
        name=None,
        verify_integrity: bool = True,
        _set_identity: bool = True,
    ):
    
        # compat with Index
        if name is not None:
            names = name
        if levels is None or codes is None:
            raise TypeError("Must pass both levels and codes")
        if len(levels) != len(codes):
            raise ValueError("Length of levels and codes must be the same.")
        if len(levels) == 0:
>           raise ValueError("Must pass non-zero number of levels/codes")
E           ValueError: Must pass non-zero number of levels/codes

pandas/core/indexes/multi.py:271: ValueError

In the failing cases we dynamically add a an xfail marker:

if reason is not None:
mark = pytest.mark.xfail(reason=reason)
request.node.add_marker(mark)
. Reported at pytest-dev/pytest#7486.

For now we can pin pytest.

@TomAugspurger TomAugspurger added Testing pandas testing functions or related to the test suite CI Continuous Integration labels Jul 13, 2020
@TomAugspurger
Copy link
Contributor Author

Seems like that failure was a bug in the RC that's being addressed.

There's a second issue with typing. I think pytest 6.x added type annotations

https://github.com/pandas-dev/pandas/pull/35260/checks?check_run_id=865426177

2020-07-13T14:14:44.8335982Z mypy --version
2020-07-13T14:14:44.9558171Z mypy 0.730
2020-07-13T14:14:44.9707532Z Performing static analysis using mypy
2020-07-13T14:15:43.9807578Z pandas/_testing.py:2901: error: Incompatible return value type (got "RaisesContext[Exception]", expected "Callable[[Type[Exception], None], None]")
2020-07-13T14:15:44.0775907Z pandas/util/_test_decorators.py:204: error: Too many arguments for "__call__" of "_SkipifMarkDecorator"
2020-07-13T14:15:49.1919390Z pandas/tests/series/test_operators.py:334: error: No overload variant of "__call__" of "_XfailMarkDecorator" matches argument types "str", "Type[AssertionError]", "bool"
2020-07-13T14:15:49.1919616Z pandas/tests/series/test_operators.py:334: note: Possible overload variant:
2020-07-13T14:15:49.1920614Z pandas/tests/series/test_operators.py:334: note:     def __call__(self, condition: Union[str, bool] = ..., *conditions: Union[str, bool], reason: str = ..., run: bool = ..., raises: Union[BaseException, Tuple[BaseException, ...]] = ..., strict: bool = ...) -> MarkDecorator
2020-07-13T14:15:49.1920996Z pandas/tests/series/test_operators.py:334: note:     <1 more non-matching overload not shown>
2020-07-13T14:15:49.1921177Z pandas/tests/series/test_operators.py:342: error: No overload variant of "__call__" of "_XfailMarkDecorator" matches argument types "str", "Type[AssertionError]", "bool"
2020-07-13T14:15:49.1921354Z pandas/tests/series/test_operators.py:342: note: Possible overload variant:
2020-07-13T14:15:49.1921878Z pandas/tests/series/test_operators.py:342: note:     def __call__(self, condition: Union[str, bool] = ..., *conditions: Union[str, bool], reason: str = ..., run: bool = ..., raises: Union[BaseException, Tuple[BaseException, ...]] = ..., strict: bool = ...) -> MarkDecorator
2020-07-13T14:15:49.1922253Z pandas/tests/series/test_operators.py:342: note:     <1 more non-matching overload not shown>
2020-07-13T14:15:54.1144745Z pandas/tests/scalar/timedelta/test_arithmetic.py:427: error: No overload variant of "__call__" of "_XfailMarkDecorator" matches argument types "bool", "Type[RuntimeWarning]", "str"
2020-07-13T14:15:54.1145582Z pandas/tests/scalar/timedelta/test_arithmetic.py:427: note: Possible overload variant:
2020-07-13T14:15:54.1146811Z pandas/tests/scalar/timedelta/test_arithmetic.py:427: note:     def __call__(self, condition: Union[str, bool] = ..., *conditions: Union[str, bool], reason: str = ..., run: bool = ..., raises: Union[BaseException, Tuple[BaseException, ...]] = ..., strict: bool = ...) -> MarkDecorator
2020-07-13T14:15:54.1147620Z pandas/tests/scalar/timedelta/test_arithmetic.py:427: note:     <1 more non-matching overload not shown>
2020-07-13T14:15:54.5191680Z pandas/tests/scalar/interval/test_ops.py:13: error: Value of type "object" is not indexable
2020-07-13T14:15:54.8349830Z pandas/tests/reshape/test_qcut.py:213: error: "object" has no attribute "dtype"
2020-07-13T14:15:57.6678820Z pandas/tests/reshape/merge/test_merge.py:69: error: "object" has no attribute "dtype"
2020-07-13T14:15:57.6679031Z pandas/tests/reshape/merge/test_merge.py:78: error: "object" has no attribute "dtype"
2020-07-13T14:15:57.6679187Z pandas/tests/reshape/merge/test_merge.py:87: error: "object" has no attribute "dtype"
2020-07-13T14:16:06.8551479Z pandas/tests/internals/test_internals.py:1135: error: "object" has no attribute "__name__"; maybe "__ne__" or "__new__"?
2020-07-13T14:16:09.0505784Z pandas/tests/indexes/test_numpy_compat.py:45: error: "object" has no attribute "__name__"; maybe "__ne__" or "__new__"?
2020-07-13T14:16:09.0506479Z pandas/tests/indexes/test_numpy_compat.py:75: error: "object" has no attribute "__name__"; maybe "__ne__" or "__new__"?
2020-07-13T14:16:09.2332370Z pandas/tests/indexes/test_engines.py:25: error: Value of type "object" is not indexable
2020-07-13T14:16:12.6062547Z pandas/tests/indexes/multi/test_analytics.py:237: error: "object" has no attribute "__name__"; maybe "__ne__" or "__new__"?
2020-07-13T14:16:12.6063318Z pandas/tests/indexes/multi/test_analytics.py:259: error: "object" has no attribute "__name__"; maybe "__ne__" or "__new__"?
2020-07-13T14:16:13.1748152Z pandas/tests/indexes/interval/test_interval.py:326: error: "object" has no attribute "dtype"
2020-07-13T14:16:13.1750477Z pandas/tests/indexes/interval/test_interval.py:379: error: "object" has no attribute "dtype"
2020-07-13T14:16:13.1751392Z pandas/tests/indexes/interval/test_interval.py:411: error: "object" has no attribute "dtype"
2020-07-13T14:16:13.4264267Z pandas/tests/indexes/interval/test_indexing.py:98: error: "object" has no attribute "dtype"
2020-07-13T14:16:13.4264528Z pandas/tests/indexes/interval/test_indexing.py:128: error: Value of type "object" is not indexable
2020-07-13T14:16:13.4264698Z pandas/tests/indexes/interval/test_indexing.py:153: error: "object" has no attribute "dtype"
2020-07-13T14:16:17.8706566Z pandas/tests/groupby/test_categorical.py:1302: error: Attribute function "__call__" with type "Callable[[str, DefaultNamedArg(bool, 'allow_module_level')], NoReturn]" does not accept self argument
2020-07-13T14:16:17.8707458Z pandas/tests/groupby/test_categorical.py:1302: error: Too many positional arguments for "skip"
2020-07-13T14:16:17.8707756Z pandas/tests/groupby/test_categorical.py:1302: error: Argument 1 to "skip" has incompatible type "str"; expected "bool"
2020-07-13T14:16:17.8708614Z pandas/tests/groupby/test_categorical.py:1335: error: Attribute function "__call__" with type "Callable[[str, DefaultNamedArg(bool, 'allow_module_level')], NoReturn]" does not accept self argument
2020-07-13T14:16:17.8708947Z pandas/tests/groupby/test_categorical.py:1335: error: Too many positional arguments for "skip"
2020-07-13T14:16:17.8709237Z pandas/tests/groupby/test_categorical.py:1335: error: Argument 1 to "skip" has incompatible type "str"; expected "bool"
2020-07-13T14:16:17.8709815Z pandas/tests/groupby/test_categorical.py:1383: error: Attribute function "__call__" with type "Callable[[str, DefaultNamedArg(bool, 'allow_module_level')], NoReturn]" does not accept self argument
2020-07-13T14:16:17.8710650Z pandas/tests/groupby/test_categorical.py:1383: error: Too many positional arguments for "skip"
2020-07-13T14:16:17.8710956Z pandas/tests/groupby/test_categorical.py:1383: error: Argument 1 to "skip" has incompatible type "str"; expected "bool"
2020-07-13T14:16:17.8711591Z pandas/tests/groupby/test_categorical.py:1413: error: Attribute function "__call__" with type "Callable[[str, DefaultNamedArg(bool, 'allow_module_level')], NoReturn]" does not accept self argument
2020-07-13T14:16:17.8712142Z pandas/tests/groupby/test_categorical.py:1413: error: Too many positional arguments for "skip"
2020-07-13T14:16:17.8712442Z pandas/tests/groupby/test_categorical.py:1413: error: Argument 1 to "skip" has incompatible type "str"; expected "bool"
2020-07-13T14:16:19.8155973Z pandas/tests/generic/test_finalize.py:538: error: Value of type "object" is not indexable
2020-07-13T14:16:26.2947961Z pandas/tests/frame/methods/test_diff.py:119: error: No overload variant of "__call__" of "_XfailMarkDecorator" matches argument types "str", "Type[AssertionError]"
2020-07-13T14:16:26.2948195Z pandas/tests/frame/methods/test_diff.py:119: note: Possible overload variant:
2020-07-13T14:16:26.2949122Z pandas/tests/frame/methods/test_diff.py:119: note:     def __call__(self, condition: Union[str, bool] = ..., *conditions: Union[str, bool], reason: str = ..., run: bool = ..., raises: Union[BaseException, Tuple[BaseException, ...]] = ..., strict: bool = ...) -> MarkDecorator
2020-07-13T14:16:26.2949711Z pandas/tests/frame/methods/test_diff.py:119: note:     <1 more non-matching overload not shown>
2020-07-13T14:16:30.0108226Z pandas/tests/arrays/interval/test_ops.py:24: error: Value of type "object" is not indexable
2020-07-13T14:16:31.6471074Z pandas/tests/arithmetic/test_numeric.py:102: error: "object" has no attribute "dtype"
2020-07-13T14:16:31.6471296Z pandas/tests/arithmetic/test_numeric.py:122: error: "object" has no attribute "dtype"
2020-07-13T14:16:31.6471474Z pandas/tests/arithmetic/test_numeric.py:556: error: No overload variant of "__call__" of "_XfailMarkDecorator" matches argument types "str", "Type[TypeError]"
2020-07-13T14:16:31.6471644Z pandas/tests/arithmetic/test_numeric.py:556: note: Possible overload variant:
2020-07-13T14:16:31.6472586Z pandas/tests/arithmetic/test_numeric.py:556: note:     def __call__(self, condition: Union[str, bool] = ..., *conditions: Union[str, bool], reason: str = ..., run: bool = ..., raises: Union[BaseException, Tuple[BaseException, ...]] = ..., strict: bool = ...) -> MarkDecorator
2020-07-13T14:16:31.6473383Z pandas/tests/arithmetic/test_numeric.py:556: note:     <1 more non-matching overload not shown>
2020-07-13T14:16:31.6473561Z pandas/tests/arithmetic/test_numeric.py:563: error: "object" has no attribute "__name__"; maybe "__ne__" or "__new__"?
2020-07-13T14:16:31.7654920Z pandas/tests/arithmetic/test_interval.py:43: error: Value of type "object" is not indexable
2020-07-13T14:16:31.7655137Z pandas/tests/arithmetic/test_interval.py:239: error: "object" has no attribute "dtype"
2020-07-13T14:16:50.4606954Z pandas/tests/window/conftest.py:79: error: Argument "marks" to "param" has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Collection[Union[MarkDecorator, Mark]]]"
2020-07-13T14:16:50.4607731Z pandas/tests/window/conftest.py:88: error: Argument "marks" to "param" has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Collection[Union[MarkDecorator, Mark]]]"
2020-07-13T14:16:54.2368928Z pandas/tests/io/test_html.py:90: error: Argument "marks" to "param" has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Collection[Union[MarkDecorator, Mark]]]"
2020-07-13T14:16:54.2369723Z pandas/tests/io/test_html.py:91: error: Argument "marks" to "param" has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Collection[Union[MarkDecorator, Mark]]]"
2020-07-13T14:16:57.6642732Z pandas/tests/io/excel/test_writers.py:54: error: List item 0 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:16:57.6643676Z pandas/tests/io/excel/test_writers.py:54: error: List item 1 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:16:57.6644079Z pandas/tests/io/excel/test_writers.py:55: error: List item 0 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:16:57.6644679Z pandas/tests/io/excel/test_writers.py:55: error: List item 1 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:16:57.6645065Z pandas/tests/io/excel/test_writers.py:56: error: List item 0 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:16:57.6645442Z pandas/tests/io/excel/test_writers.py:56: error: List item 1 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:16:57.6645812Z pandas/tests/io/excel/test_writers.py:58: error: List item 0 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:16:57.6646172Z pandas/tests/io/excel/test_writers.py:58: error: List item 1 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:16:57.6646553Z pandas/tests/io/excel/test_writers.py:60: error: Argument "marks" to "param" has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Collection[Union[MarkDecorator, Mark]]]"
2020-07-13T14:16:57.6646964Z pandas/tests/io/excel/test_writers.py:303: error: List item 0 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:16:57.6647694Z pandas/tests/io/excel/test_writers.py:303: error: List item 1 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:16:57.6648145Z pandas/tests/io/excel/test_writers.py:308: error: List item 0 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:16:57.6648768Z pandas/tests/io/excel/test_writers.py:308: error: List item 1 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:16:57.6649297Z pandas/tests/io/excel/test_writers.py:311: error: List item 0 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:16:57.6649720Z pandas/tests/io/excel/test_writers.py:311: error: List item 1 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:16:57.6650432Z pandas/tests/io/excel/test_writers.py:316: error: List item 0 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:16:57.6650796Z pandas/tests/io/excel/test_writers.py:316: error: List item 1 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:16:57.6651169Z pandas/tests/io/excel/test_writers.py:318: error: Argument "marks" to "param" has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Collection[Union[MarkDecorator, Mark]]]"
2020-07-13T14:16:57.6651562Z pandas/tests/io/excel/test_writers.py:1316: error: Argument "marks" to "param" has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Collection[Union[MarkDecorator, Mark]]]"
2020-07-13T14:16:57.6651952Z pandas/tests/io/excel/test_writers.py:1317: error: Argument "marks" to "param" has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Collection[Union[MarkDecorator, Mark]]]"
2020-07-13T14:16:57.6652373Z pandas/tests/io/excel/test_writers.py:1318: error: Argument "marks" to "param" has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Collection[Union[MarkDecorator, Mark]]]"
2020-07-13T14:16:57.9319242Z pandas/tests/io/excel/test_readers.py:41: error: List item 0 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:16:57.9319473Z pandas/tests/io/excel/test_readers.py:48: error: List item 0 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:16:57.9319651Z pandas/tests/io/excel/test_readers.py:55: error: List item 0 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:16:57.9319844Z pandas/tests/io/excel/test_readers.py:59: error: Argument "marks" to "param" has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Collection[Union[MarkDecorator, Mark]]]"
2020-07-13T14:16:57.9320046Z pandas/tests/io/excel/test_readers.py:60: error: Argument "marks" to "param" has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Collection[Union[MarkDecorator, Mark]]]"
2020-07-13T14:17:00.3359703Z pandas/tests/frame/test_analytics.py:1071: error: List item 0 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:17:00.3360004Z pandas/tests/frame/test_analytics.py:1077: error: List item 0 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:17:00.3360406Z pandas/tests/frame/test_analytics.py:1083: error: List item 0 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:17:00.3360574Z pandas/tests/frame/test_analytics.py:1089: error: List item 0 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:17:00.3360739Z pandas/tests/frame/test_analytics.py:1095: error: List item 0 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:17:00.3360909Z pandas/tests/frame/test_analytics.py:1101: error: List item 0 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:17:00.3361574Z pandas/tests/frame/test_analytics.py:1107: error: List item 0 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:17:00.3361740Z pandas/tests/frame/test_analytics.py:1113: error: List item 0 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:17:00.3361904Z pandas/tests/frame/test_analytics.py:1128: error: List item 0 has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Mark]"
2020-07-13T14:17:01.6972733Z pandas/tests/dtypes/test_common.py:159: error: "object" has no attribute "__name__"; maybe "__ne__" or "__new__"?
2020-07-13T14:17:03.2097902Z pandas/tests/arrays/sparse/test_array.py:198: error: Argument "marks" to "param" has incompatible type "Callable[..., Any]"; expected "Union[MarkDecorator, Collection[Union[MarkDecorator, Mark]]]"
2020-07-13T14:17:03.3814832Z pandas/tests/arrays/interval/test_interval.py:31: error: Value of type "object" is not indexable
2020-07-13T14:17:05.5035255Z pandas/tests/plotting/test_frame.py:2699: error: No overload variant of "__call__" of "_XfailMarkDecorator" matches argument types "str", "Type[ValueError]"
2020-07-13T14:17:05.5035489Z pandas/tests/plotting/test_frame.py:2699: note: Possible overload variant:
2020-07-13T14:17:05.5036483Z pandas/tests/plotting/test_frame.py:2699: note:     def __call__(self, condition: Union[str, bool] = ..., *conditions: Union[str, bool], reason: str = ..., run: bool = ..., raises: Union[BaseException, Tuple[BaseException, ...]] = ..., strict: bool = ...) -> MarkDecorator
2020-07-13T14:17:05.5036892Z pandas/tests/plotting/test_frame.py:2699: note:     <1 more non-matching overload not shown>
2020-07-13T14:17:06.2896265Z pandas/tests/extension/test_sparse.py:365: error: No overload variant of "__call__" of "_XfailMarkDecorator" matches argument types "Type[TypeError]", "str"
2020-07-13T14:17:06.2896699Z pandas/tests/extension/test_sparse.py:365: note: Possible overload variant:
2020-07-13T14:17:06.2897670Z pandas/tests/extension/test_sparse.py:365: note:     def __call__(self, condition: Union[str, bool] = ..., *conditions: Union[str, bool], reason: str = ..., run: bool = ..., raises: Union[BaseException, Tuple[BaseException, ...]] = ..., strict: bool = ...) -> MarkDecorator
2020-07-13T14:17:06.2898058Z pandas/tests/extension/test_sparse.py:365: note:     <1 more non-matching overload not shown>
2020-07-13T14:17:07.3084525Z Found 87 errors in 29 files (checked 1028 source files)
2020-07-13T14:17:09.2130278Z Performing static analysis using mypy DONE

cc @simonjayhawkins if you have suggestions for how to proceed on any of those.

@simonjayhawkins
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants