diff options
author | John Szakmeister <john@szakmeister.net> | 2014-07-25 05:29:25 -0400 |
---|---|---|
committer | John Szakmeister <john@szakmeister.net> | 2014-10-24 16:42:27 -0400 |
commit | 889d41f3374f65ad6934dc0a636104e9ec11a502 (patch) | |
tree | b8cad482147a7dd671cc62737df74e1a1a96b6fc | |
parent | 23a3ca8cc1d4c72eec82b421701d248d10d70d0d (diff) | |
download | nose-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.py | 5 |
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) |