Skip to content

Commit

Permalink
TST Default skip network tests (scikit-learn#18002)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjpfan authored and jayzed82 committed Oct 22, 2020
1 parent e7860a8 commit ff26633
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit ff26633

Please sign in to comment.