[pypy-commit] pypy py3k: Python 3 syntax changes in zpickle tests
dusty
noreply at buildbot.pypy.org
Wed Mar 14 11:32:28 CET 2012
Author: Dusty Phillips <dusty at buchuki.com>
Branch: py3k
Changeset: r53545:a609f7a7a5fa
Date: 2012-03-13 17:52 -0700
http://bitbucket.org/pypy/pypy/changeset/a609f7a7a5fa/
Log: Python 3 syntax changes in zpickle tests
diff --git a/pypy/module/_continuation/test/test_zpickle.py b/pypy/module/_continuation/test/test_zpickle.py
--- a/pypy/module/_continuation/test/test_zpickle.py
+++ b/pypy/module/_continuation/test/test_zpickle.py
@@ -57,10 +57,10 @@
assert lst4 == [co4]
def test_copy_continulet_real(self):
- import new, sys
- mod = new.module('test_copy_continulet_real')
+ import types, sys
+ mod = types.ModuleType('test_copy_continulet_real')
sys.modules['test_copy_continulet_real'] = mod
- exec '''if 1:
+ exec('''if 1:
from _continuation import continulet
import copy
def f(co, x):
@@ -85,7 +85,7 @@
res = co.switch()
assert res == 43
assert not co.is_pending()
- ''' in mod.__dict__
+ ''', mod.__dict__)
def test_copy_continulet_already_finished(self):
from _continuation import continulet, error
@@ -130,7 +130,7 @@
co = continulet.__new__(continulet)
import pickle
pckl = pickle.dumps(co, self.version)
- print repr(pckl)
+ print(repr(pckl))
co2 = pickle.loads(pckl)
assert co2 is not co
assert not co.is_pending()
@@ -150,7 +150,7 @@
co.bar = 'baz'
import pickle
pckl = pickle.dumps(co, self.version)
- print repr(pckl)
+ print(repr(pckl))
co2 = pickle.loads(pckl)
assert co2 is not co
assert not co.is_pending()
@@ -171,21 +171,21 @@
lst = []
co = continulet(lst.append)
pckl = pickle.dumps((co, lst))
- print pckl
+ print(pckl)
del co, lst
for i in range(2):
- print 'resume...'
+ print('resume...')
co2, lst2 = pickle.loads(pckl)
assert lst2 == []
co2.switch()
assert lst2 == [co2]
def test_pickle_continulet_real(self):
- import new, sys
- mod = new.module('test_pickle_continulet_real')
+ import types, sys
+ mod = types.ModuleType('test_copy_continulet_real')
sys.modules['test_pickle_continulet_real'] = mod
mod.version = self.version
- exec '''if 1:
+ exec('''if 1:
from _continuation import continulet
import pickle
def f(co, x):
@@ -196,7 +196,7 @@
res = co.switch()
assert res == 41
pckl = pickle.dumps(co, version)
- print repr(pckl)
+ print(repr(pckl))
co2 = pickle.loads(pckl)
#
res = co2.switch()
@@ -212,14 +212,14 @@
res = co.switch()
assert res == 43
assert not co.is_pending()
- ''' in mod.__dict__
+ ''', mod.__dict__)
def test_pickle_continulet_real_subclass(self):
- import new, sys
- mod = new.module('test_pickle_continulet_real_subclass')
+ import types, sys
+ mod = types.ModuleType('test_copy_continulet_real_subclass')
sys.modules['test_pickle_continulet_real_subclass'] = mod
mod.version = self.version
- exec '''if 1:
+ exec('''if 1:
from _continuation import continulet
import pickle
class A(continulet):
@@ -235,7 +235,7 @@
res = co.switch()
assert res == 41
pckl = pickle.dumps(co, version)
- print repr(pckl)
+ print(repr(pckl))
co2 = pickle.loads(pckl)
#
assert type(co2) is A
@@ -252,7 +252,7 @@
res = co.switch()
assert res == 43
assert not co.is_pending()
- ''' in mod.__dict__
+ ''', mod.__dict__)
class AppTestPickle_v1(AppTestPickle):
More information about the pypy-commit
mailing list