Skip to content

Tests raise Warnings in CI Linux pylatest_pip_openblas_pandas #16651

Closed

Description

@cmarmo

The build for Linux pylatest_pip_openblas_pandas Azure pipeline, still raise warnings in test execution (see cmarmo/scikit-learn/#11).

command line and environment

+ python -m pytest --showlocals --durations=20 --junitxml=test-data.xml --cov-config=/home/vsts/work/1/s/.coveragerc --cov sklearn -Werror::DeprecationWarning -Werror::FutureWarning -Werror --pyargs sklearn
============================= test session starts ==============================
platform linux -- Python 3.8.1, pytest-4.6.2, py-1.8.1, pluggy-0.13.1
rootdir: /home/vsts/work/tmp_folder, inifile: setup.cfg
plugins: xdist-1.31.0, cov-2.8.1, forked-1.1.3
collected 9107 items / 3 errors / 9104 selected

Failing tests

  • sklearn/ensemble/tests/test_gradient_boosting.py:431: [MRG] Define custom markers for pytest. #16652
    _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.
    

Check the log here

Activity

  1. cmarmo commented on Mar 16, 2020

    @cmarmo
    ContributorAuthor

    @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.
  2. jnothman commented on Mar 17, 2020

    @jnothman
    Member
  3. cmarmo commented on Mar 23, 2020

    @cmarmo
    ContributorAuthor

    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.

  4. cmarmo commented on Jul 3, 2020

    @cmarmo
    ContributorAuthor

    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>
    

    @glemaitre, is that expected? Thanks!

  5. glemaitre commented on Jul 3, 2020

    @glemaitre
    Member

    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.basic does 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-test

    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.

  6. glemaitre commented on Jul 3, 2020

    @glemaitre
    Member

    I have hope that #17828 will solve the issue

  7. cmarmo commented on Jul 3, 2020

    @cmarmo
    ContributorAuthor

    @glemaitre, feel free to open a PR to my test-fails-on-warnings branch to check if the warning is gone.

  8. cmarmo commented on Aug 22, 2020

    @cmarmo
    ContributorAuthor

    Closing, after 5 months new warnings are there and I can't edit and recycle this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions