Jerry James 180205f
diff -Naur networkx-1.9.orig/networkx/tests/test.py networkx-1.9/networkx/tests/test.py
Jerry James 180205f
--- networkx-1.9.orig/networkx/tests/test.py	2014-06-25 11:50:58.000000000 -0600
Jerry James 180205f
+++ networkx-1.9/networkx/tests/test.py	2014-06-30 12:00:00.000000000 -0600
bbe80c5
@@ -2,6 +2,24 @@
bbe80c5
 import sys
bbe80c5
 from os import path,getcwd
bbe80c5
 
bbe80c5
+import pkg_resources
bbe80c5
+
bbe80c5
+# If there is a conflicting non egg module,
bbe80c5
+# i.e. an older standard system module installed,
bbe80c5
+# then replace it with this requirement
bbe80c5
+def replace_dist(requirement):
bbe80c5
+    try:
bbe80c5
+        return pkg_resources.require(requirement)
bbe80c5
+    except pkg_resources.VersionConflict:
bbe80c5
+        e = sys.exc_info()[1]
bbe80c5
+        dist=e.args[0]
bbe80c5
+        req=e.args[1]
bbe80c5
+        if dist.key == req.key and not dist.location.endswith('.egg'):
bbe80c5
+            del pkg_resources.working_set.by_key[dist.key]
bbe80c5
+            # We assume there is no need to adjust sys.path
bbe80c5
+            # and the associated pkg_resources.working_set.entries
bbe80c5
+            return pkg_resources.require(requirement)
bbe80c5
+
bbe80c5
 def run(verbosity=1,doctest=False,numpy=True):
bbe80c5
     """Run NetworkX tests.
bbe80c5
 
bbe80c5
@@ -16,6 +34,8 @@
bbe80c5
     numpy: bool, optional
bbe80c5
       True to test modules dependent on numpy
bbe80c5
     """
bbe80c5
+    replace_dist("nose >= 1.0")
bbe80c5
+
bbe80c5
     try:
bbe80c5
         import nose
bbe80c5
     except ImportError: