nose1.1 is needed for the attrib plugin also only exclude nx_shp.py if packaging in separate sub package
38 lines
1.2 KiB
Diff
38 lines
1.2 KiB
Diff
diff -Naur networkx-1.8.1.orig/networkx/tests/test.py networkx-1.8.1/networkx/tests/test.py
|
|
--- networkx-1.8.1.orig/networkx/tests/test.py 2013-08-04 13:53:31.000000000 +0000
|
|
+++ networkx-1.8.1/networkx/tests/test.py 2014-03-17 20:49:15.624551199 +0000
|
|
@@ -2,6 +2,24 @@
|
|
import sys
|
|
from os import path,getcwd
|
|
|
|
+import pkg_resources
|
|
+
|
|
+# If there is a conflicting non egg module,
|
|
+# i.e. an older standard system module installed,
|
|
+# then replace it with this requirement
|
|
+def replace_dist(requirement):
|
|
+ try:
|
|
+ return pkg_resources.require(requirement)
|
|
+ except pkg_resources.VersionConflict:
|
|
+ e = sys.exc_info()[1]
|
|
+ dist=e.args[0]
|
|
+ req=e.args[1]
|
|
+ if dist.key == req.key and not dist.location.endswith('.egg'):
|
|
+ del pkg_resources.working_set.by_key[dist.key]
|
|
+ # We assume there is no need to adjust sys.path
|
|
+ # and the associated pkg_resources.working_set.entries
|
|
+ return pkg_resources.require(requirement)
|
|
+
|
|
def run(verbosity=1,doctest=False,numpy=True):
|
|
"""Run NetworkX tests.
|
|
|
|
@@ -16,6 +34,8 @@
|
|
numpy: bool, optional
|
|
True to test modules dependent on numpy
|
|
"""
|
|
+ replace_dist("nose >= 1.0")
|
|
+
|
|
try:
|
|
import nose
|
|
except ImportError:
|