Skip to content
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

TST Default skip network tests in datatests' common tests #18002

Merged
merged 1 commit into from
Jul 27, 2020
Merged
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: 3 additions & 3 deletions sklearn/datasets/tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ def check_as_frame(bunch, dataset_func,
assert np.all(frame_bunch.target.dtypes == expected_target_dtype)


def _has_network():
return bool(os.environ.get("SKLEARN_SKIP_NETWORK_TESTS", False))
def _skip_network_tests():
return os.environ.get('SKLEARN_SKIP_NETWORK_TESTS', '1') == '1'


def _generate_func_supporting_param(param, dataset_type=("load", "fetch")):
Expand All @@ -91,7 +91,7 @@ def _generate_func_supporting_param(param, dataset_type=("load", "fetch")):
if is_dataset_type and is_support_param:
# check if we should skip if we don't have network support
marks = [pytest.mark.skipif(
condition=name.startswith("fetch") and _has_network(),
condition=name.startswith("fetch") and _skip_network_tests(),
reason="Skip because fetcher requires internet network",
)]
if name in markers_fetch:
Expand Down