summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Szakmeister <john@szakmeister.net>2014-07-25 05:29:25 -0400
committerJohn Szakmeister <john@szakmeister.net>2014-10-24 16:42:27 -0400
commit889d41f3374f65ad6934dc0a636104e9ec11a502 (patch)
treeb8cad482147a7dd671cc62737df74e1a1a96b6fc
parent23a3ca8cc1d4c72eec82b421701d248d10d70d0d (diff)
downloadnose-889d41f3374f65ad6934dc0a636104e9ec11a502.tar.gz
Fix #815: "ValueError: unsupported pickle protocol" with --with-id...
This would occur by running `nosetests --with-id` with a newer version of Python, and then run again with an older version of Python who doesn't recognize the pickle format. In this case, let's simply ignore the file, and move on allowing nosetests to overwrite it after gathering the data again.
-rw-r--r--nose/plugins/testid.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/nose/plugins/testid.py b/nose/plugins/testid.py
index 49fff9b..ae8119b 100644
--- a/nose/plugins/testid.py
+++ b/nose/plugins/testid.py
@@ -198,6 +198,11 @@ class TestId(Plugin):
self.ids, self.tests, self.failed, self.source_names,
self.idfile)
fh.close()
+ except ValueError, e:
+ # load() may throw a ValueError when reading the ids file, if it
+ # was generated with a newer version of Python than we are currently
+ # running.
+ log.debug('Error loading %s : %s', self.idfile, str(e))
except IOError:
log.debug('IO error reading %s', self.idfile)