Commit 6fa96796 authored by Ralf Schmitt's avatar Ralf Schmitt

hide test__greenlet's test_func from py.test by renaming it

otherwise py.test executes it as a test function.
parent 864056fe
...@@ -100,13 +100,13 @@ class TestUnlink(greentest.TestCase): ...@@ -100,13 +100,13 @@ class TestUnlink(greentest.TestCase):
def setUp(self): def setUp(self):
greentest.TestCase.setUp(self) greentest.TestCase.setUp(self)
self.p = gevent.spawn(test_func) self.p = gevent.spawn(dummy_test_func)
def _test_func(self, link): def _test_func(self, link):
p = self.p p = self.p
link(test_func) link(dummy_test_func)
assert len(p._links) == 1, p._links assert len(p._links) == 1, p._links
p.unlink(test_func) p.unlink(dummy_test_func)
assert not p._links, p._links assert not p._links, p._links
link(self.setUp) link(self.setUp)
...@@ -404,7 +404,7 @@ class TestStuff(greentest.TestCase): ...@@ -404,7 +404,7 @@ class TestStuff(greentest.TestCase):
sleep(DELAY) sleep(DELAY)
def test_func(*args): def dummy_test_func(*args):
pass pass
...@@ -419,12 +419,12 @@ hexobj = re.compile('-?0x[0123456789abcdef]+L?', re.I) ...@@ -419,12 +419,12 @@ hexobj = re.compile('-?0x[0123456789abcdef]+L?', re.I)
class TestStr(greentest.TestCase): class TestStr(greentest.TestCase):
def test_function(self): def test_function(self):
g = gevent.Greenlet.spawn(test_func) g = gevent.Greenlet.spawn(dummy_test_func)
self.assertEqual(hexobj.sub('X', str(g)), '<Greenlet at X: test_func>') self.assertEqual(hexobj.sub('X', str(g)), '<Greenlet at X: dummy_test_func>')
assert_not_ready(g) assert_not_ready(g)
g.join() g.join()
assert_ready(g) assert_ready(g)
self.assertEqual(hexobj.sub('X', str(g)), '<Greenlet at X: test_func>') self.assertEqual(hexobj.sub('X', str(g)), '<Greenlet at X: dummy_test_func>')
def test_method(self): def test_method(self):
g = gevent.Greenlet.spawn(A().method) g = gevent.Greenlet.spawn(A().method)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment