summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/TESTS.rst.txt9
-rw-r--r--numpy/lib/_datasource.py9
2 files changed, 5 insertions, 13 deletions
diff --git a/doc/TESTS.rst.txt b/doc/TESTS.rst.txt
index 5fe0be1f1..daf82aaaa 100644
--- a/doc/TESTS.rst.txt
+++ b/doc/TESTS.rst.txt
@@ -120,15 +120,6 @@ that makes it hard to identify the test from the output of running the test
suite with ``verbose=2`` (or similar verbosity setting). Use plain comments
(``#``) if necessary.
-Sometimes it is convenient to run ``test_yyy.py`` by itself, so we add
-
-::
-
- if __name__ == "__main__":
- run_module_suite()
-
-at the bottom.
-
Labeling tests
--------------
diff --git a/numpy/lib/_datasource.py b/numpy/lib/_datasource.py
index 3a0e67f60..816f7624e 100644
--- a/numpy/lib/_datasource.py
+++ b/numpy/lib/_datasource.py
@@ -547,6 +547,11 @@ class DataSource(object):
is accessible if it exists in either location.
"""
+
+ # First test for local path
+ if os.path.exists(path):
+ return True
+
# We import this here because importing urllib2 is slow and
# a significant fraction of numpy's total import time.
if sys.version_info[0] >= 3:
@@ -556,10 +561,6 @@ class DataSource(object):
from urllib2 import urlopen
from urllib2 import URLError
- # Test local path
- if os.path.exists(path):
- return True
-
# Test cached url
upath = self.abspath(path)
if os.path.exists(upath):