Permalink
Browse files

Start each test with clear engine namespaces

closes gh-386
  • Loading branch information...
minrk committed Apr 14, 2011
1 parent b191e9a commit 0d3d807cf14a0307d529d36108ed614f087de795
@@ -93,6 +93,8 @@ def assertRaisesRemote(self, etype, f, *args, **kwargs):
def setUp(self):
BaseZMQTestCase.setUp(self)
self.client = self.connect_client()
+ # start every test with clean engine namespaces:
+ self.client.clear(block=True)
self.base_engine_count=len(self.client.ids)
self.engines=[]
@@ -85,8 +85,8 @@ def test_clear(self):
v.push(dict(a=5))
v.pull('a')
id0 = self.client.ids[-1]
- self.client.clear(targets=id0)
- self.client[:-1].pull('a')
+ self.client.clear(targets=id0, block=True)
+ a = self.client[:-1].get('a')
self.assertRaisesRemote(NameError, self.client[id0].get, 'a')
self.client.clear(block=True)
for i in self.client.ids:
@@ -298,7 +298,8 @@ def test_importer(self):
def findall(pat, s):
# this globals() step isn't necessary in real code
# only to prevent a closure in the test
- return globals()['re'].findall(pat, s)
+ re = globals()['re']
+ return re.findall(pat, s)
self.assertEquals(view.apply_sync(findall, '\w+', 'hello world'), 'hello world'.split())

0 comments on commit 0d3d807

Please sign in to comment.