Skip to content

Commit

Permalink
Fix test under py26
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Apr 1, 2015
1 parent 4bd8b8c commit 578ac70
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/zodbpickle/tests/pickletester_2.py
Expand Up @@ -1178,16 +1178,17 @@ def test_incomplete_input(self):
s = StringIO.StringIO("X''.")
self.assertRaises(EOFError, self.module.load, s)

@unittest.skipIf(_is_pypy,
"Fails to access the redefined builtins")
def test_restricted(self):
# issue7128: cPickle failed in restricted mode
builtins = {'pickleme': self.module,
'__import__': __import__}
d = {}
teststr = "def f(): pickleme.dumps(0)"
exec teststr in {'__builtins__': builtins}, d
d['f']()
if not _is_pypy:
# PyPy cannot redefine the builtins;
# don't use unittest.skipIf because that's not in 2.6
def test_restricted(self):
# issue7128: cPickle failed in restricted mode
builtins = {'pickleme': self.module,
'__import__': __import__}
d = {}
teststr = "def f(): pickleme.dumps(0)"
exec teststr in {'__builtins__': builtins}, d
d['f']()

def test_bad_input(self):
# Test issue4298
Expand Down

0 comments on commit 578ac70

Please sign in to comment.