Thanks to visit codestin.com
Credit goes to github.com

Skip to content

CLN avoid nested conftests #27954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.