Skip to content

Commit

Permalink
CLN avoid nested conftests (scikit-learn#27954)
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlie-XIAO authored Dec 13, 2023
1 parent dc23e3f commit 4d353c6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 18 deletions.
6 changes: 0 additions & 6 deletions conftest.py

This file was deleted.

10 changes: 9 additions & 1 deletion sklearn/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from _pytest.doctest import DoctestItem
from threadpoolctl import threadpool_limits

from sklearn import config_context
from sklearn import config_context, set_config
from sklearn._min_dependencies import PYTEST_MIN_VERSION
from sklearn.datasets import (
fetch_20newsgroups,
Expand Down Expand Up @@ -278,3 +278,11 @@ def mocked_import(name, *args, **kwargs):
return import_orig(name, *args, **kwargs)

monkeypatch.setattr(builtins, "__import__", mocked_import)


@pytest.fixture
def print_changed_only_false():
"""Set `print_changed_only` to False for the duration of the test."""
set_config(print_changed_only=False)
yield
set_config(print_changed_only=True) # reset to default
1 change: 0 additions & 1 deletion sklearn/externals/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
# using --pyargs
def pytest_ignore_collect(path, config):
return True

10 changes: 0 additions & 10 deletions sklearn/utils/tests/conftest.py

This file was deleted.

0 comments on commit 4d353c6

Please sign in to comment.