Skip to content

ENH: fake http proxy in case of --skip-network testing #19757

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 3 commits into from
Feb 19, 2018
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
5 changes: 5 additions & 0 deletions ci/script_multi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ if [ -n "$LOCALE_OVERRIDE" ]; then
python -c "$pycmd"
fi

# Enforce absent network during testing by faking a proxy
if echo "$TEST_ARGS" | grep -e --skip-network -q; then
export http_proxy=http://1.2.3.4 https_proxy=http://1.2.3.4;
fi

# Workaround for pytest-xdist flaky collection order
# https://github.com/pytest-dev/pytest/issues/920
# https://github.com/pytest-dev/pytest/issues/1075
Expand Down
5 changes: 5 additions & 0 deletions ci/script_single.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ if [ "$SLOW" ]; then
TEST_ARGS="--only-slow --skip-network"
fi

# Enforce absent network during testing by faking a proxy
if echo "$TEST_ARGS" | grep -e --skip-network -q; then
export http_proxy=http://1.2.3.4 https_proxy=http://1.2.3.4;
fi

if [ "$PIP_BUILD_TEST" ]; then
echo "We are not running pytest as this is a build test."

Expand Down
2 changes: 2 additions & 0 deletions pandas/tests/test_downstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def test_xarray(df):
assert df.to_xarray() is not None


@tm.network
def test_statsmodels():

statsmodels = import_module('statsmodels') # noqa
Expand All @@ -73,6 +74,7 @@ def test_scikit_learn(df):
clf.predict(digits.data[-1:])


@tm.network
def test_seaborn():

seaborn = import_module('seaborn')
Expand Down