diff --git a/conftest.py b/conftest.py deleted file mode 100644 index e4e478d2d72d7..0000000000000 --- a/conftest.py +++ /dev/null @@ -1,6 +0,0 @@ -# Even if empty this file is useful so that when running from the root folder -# ./sklearn is added to sys.path by pytest. See -# https://docs.pytest.org/en/latest/explanation/pythonpath.html for more -# details. For example, this allows to build extensions in place and run pytest -# doc/modules/clustering.rst and use sklearn from the local folder rather than -# the one from site-packages. diff --git a/sklearn/conftest.py b/sklearn/conftest.py index d15f9fe2ec142..d2f44f6912b62 100644 --- a/sklearn/conftest.py +++ b/sklearn/conftest.py @@ -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, @@ -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 diff --git a/sklearn/externals/conftest.py b/sklearn/externals/conftest.py index c617107866b92..7f7a4af349878 100644 --- a/sklearn/externals/conftest.py +++ b/sklearn/externals/conftest.py @@ -4,4 +4,3 @@ # using --pyargs def pytest_ignore_collect(path, config): return True - diff --git a/sklearn/utils/tests/conftest.py b/sklearn/utils/tests/conftest.py deleted file mode 100644 index 148225a481f69..0000000000000 --- a/sklearn/utils/tests/conftest.py +++ /dev/null @@ -1,10 +0,0 @@ -import pytest - -import sklearn - - -@pytest.fixture -def print_changed_only_false(): - sklearn.set_config(print_changed_only=False) - yield - sklearn.set_config(print_changed_only=True) # reset to default