Skip to content

Commit 4d353c6

Browse files
authored
CLN avoid nested conftests (scikit-learn#27954)
1 parent dc23e3f commit 4d353c6

File tree

4 files changed

+9
-18
lines changed

4 files changed

+9
-18
lines changed

conftest.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

sklearn/conftest.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from _pytest.doctest import DoctestItem
1313
from threadpoolctl import threadpool_limits
1414

15-
from sklearn import config_context
15+
from sklearn import config_context, set_config
1616
from sklearn._min_dependencies import PYTEST_MIN_VERSION
1717
from sklearn.datasets import (
1818
fetch_20newsgroups,
@@ -278,3 +278,11 @@ def mocked_import(name, *args, **kwargs):
278278
return import_orig(name, *args, **kwargs)
279279

280280
monkeypatch.setattr(builtins, "__import__", mocked_import)
281+
282+
283+
@pytest.fixture
284+
def print_changed_only_false():
285+
"""Set `print_changed_only` to False for the duration of the test."""
286+
set_config(print_changed_only=False)
287+
yield
288+
set_config(print_changed_only=True) # reset to default

sklearn/externals/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44
# using --pyargs
55
def pytest_ignore_collect(path, config):
66
return True
7-

sklearn/utils/tests/conftest.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)