1
0
mirror of https://github.com/gsi-upm/senpy synced 2025-08-23 18:12:20 +00:00

Fixed pickling error in py2.7

This commit is contained in:
J. Fernando Sánchez
2017-05-17 16:51:01 +02:00
parent ea91e3e4a4
commit 0f89b92457
2 changed files with 3 additions and 4 deletions

View File

@@ -91,8 +91,8 @@ class PluginsTest(TestCase):
with open(emptyfile, 'w+b'), open(invalidfile, 'w+b') as inf:
inf.write(b'ohno')
files = {emptyfile: ['empty file', EOFError],
invalidfile: ['invalid file', pickle.UnpicklingError]}
files = {emptyfile: ['empty file', (EOFError, IndexError)],
invalidfile: ['invalid file', (pickle.UnpicklingError, IndexError)]}
for fn in files:
with open(fn, 'rb') as f:
@@ -105,7 +105,6 @@ class PluginsTest(TestCase):
assert os.path.isfile(a.shelf_file)
print('Shelf file: %s' % a.shelf_file)
with self.assertRaises(error):
# By default, raise an error
a.sh['a'] = 'fromA'
a.save()
del a._sh