You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tests raise Warnings in CI Linux pylatest_pip_openblas_pandas #16651
_pytest.warning_types.PytestUnknownMarkWarning: Unknown pytest.mark.network - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
sklearn/utils/estimator_checks.py:401: in
checks_with_marks = (
sklearn.exceptions.SkipTestWarning: Explicit SKIP via _skip_test tag for estimator ClassifierChain.
sklearn/utils/estimator_checks.py:349: in
yield from ((estimator, partial(check, name))
sklearn.exceptions.SkipTestWarning: Explicit SKIP via _skip_test tag for estimator ClassifierChain.
sklearn/utils/estimator_checks.py:252: in _yield_all_checks
warnings.warn("Explicit SKIP via _skip_test tag for estimator "
sklearn.exceptions.SkipTestWarning: Explicit SKIP via _skip_test tag for estimator ClassifierChain.
@rth, please, I need a direction for the SkipTestWarning: this is a warning defined in scikit-learn, captured as an error by pytest when the -Werror is activated. Should this be silent? If yes, two options come to my mind:
add a filter in the pytest configuration to ignore SkipTestWarnings
change the way the tests are skipped, skipping them via specific markers in the pytest configuration rather than via scikit-learn exceptions.
I prefer the second one, I think it's cleaner because it separates the test behavior from the code execution. But it implies major changes.
Maybe nobody considers this a critical point, so the change is just not needed.... just let me know what to do... Thanks a lot for your help.
We use SkipTestWarning in estimator_checks.py which is intentionally not
dependent on pytest (to make it available to downstream packages not using
pytest). Is it possible that this is why we are not using pytest features
there?
Thank you @jnothman for your answer.
For some reason (still unclear to me), the only way I've found to filter out SkipTestWarning is adding
-Wignore::sklearn.exceptions.SkipTestWarning
to the command line (neither setup.cfg or pytest.ini behave as I thought).
I don't think it is worth to add this filter directly in the CI command line (unless one day warnings will really be raised as errors). May I close this one? Thanks for your patience.
A new warning has showed up after the merge of #17599. (transformed in error in the build of my test PR)
________________ ERROR collecting datasets/tests/test_common.py ________________
../1/s/sklearn/datasets/tests/test_common.py:97: in _generate_func_supporting_param
marks.append(markers_fetch.get(name, pytest.mark.basic))
dataset_type = ('load', 'fetch')
is_dataset_type = True
is_support_param = True
markers_fetch = {'fetch_20newsgroups': MarkDecorator(mark=Mark(name='xfail', args=(), kwargs={'reason': 'X is a list and does not have...enml': MarkDecorator(mark=Mark(name='xfail', args=(), kwargs={'reason': 'fetch_opeml requires a dataset name or id'}))}
marks = [MarkDecorator(mark=Mark(name='skipif', args=(), kwargs={'condition': True, 'reason': 'Skip because fetcher requires internet network'}))]
name = 'fetch_20newsgroups'
obj = <function fetch_20newsgroups at 0x7fdb80337040>
param = 'return_X_y'
/usr/share/miniconda/envs/testvenv/lib/python3.8/site-packages/_pytest/mark/structures.py:346: in __getattr__
warnings.warn(
E pytest.PytestUnknownMarkWarning: Unknown pytest.mark.basic - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
line = 'network: mark a test for execution if network available.'
marker = 'network'
name = 'basic'
self = <_pytest.mark.structures.MarkGenerator object at 0x7fdb948fcca0>
But most probably it was a custom marker. Basically, I want to have a marker that does not do anything. I think that None would not work bu I am not sure.
Activity
cmarmo commentedon Mar 16, 2020
@rth, please, I need a direction for the
SkipTestWarning: this is a warning defined in scikit-learn, captured as an error by pytest when the-Werroris activated. Should this be silent? If yes, two options come to my mind:pytestconfiguration to ignoreSkipTestWarningsI prefer the second one, I think it's cleaner because it separates the test behavior from the code execution. But it implies major changes.
Maybe nobody considers this a critical point, so the change is just not needed.... just let me know what to do... Thanks a lot for your help.
jnothman commentedon Mar 17, 2020
cmarmo commentedon Mar 23, 2020
Thank you @jnothman for your answer.
For some reason (still unclear to me), the only way I've found to filter out SkipTestWarning is adding
to the command line (neither
setup.cfgorpytest.inibehave as I thought).I don't think it is worth to add this filter directly in the CI command line (unless one day warnings will really be raised as errors).
May I close this one?Thanks for your patience.cmarmo commentedon Jul 3, 2020
A new warning has showed up after the merge of #17599. (transformed in error in the build of my test PR)
@glemaitre, is that expected? Thanks!
glemaitre commentedon Jul 3, 2020
Nop. this is coming from line 97: https://github.com/scikit-learn/scikit-learn/blame/master/sklearn/datasets/tests/test_common.py#L97
Apparently
pytest.mark.basicdoes not exist. I blindly believed that it was defined following the doc: https://docs.pytest.org/en/stable/example/parametrize.html#set-marks-or-test-id-for-individual-parametrized-testBut most probably it was a custom marker. Basically, I want to have a marker that does not do anything. I think that
Nonewould not work bu I am not sure.glemaitre commentedon Jul 3, 2020
I have hope that #17828 will solve the issue
cmarmo commentedon Jul 3, 2020
@glemaitre, feel free to open a PR to my test-fails-on-warnings branch to check if the warning is gone.
cmarmo commentedon Aug 22, 2020
Closing, after 5 months new warnings are there and I can't edit and recycle this issue.