You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
356 B
Python
19 lines
356 B
Python
5 years ago
|
from gevent import get_hub
|
||
|
from gevent import testing as greentest
|
||
|
|
||
|
class Test(greentest.TestCase):
|
||
|
def test(self):
|
||
|
count = [0]
|
||
|
|
||
|
def incr():
|
||
|
count[0] += 1
|
||
|
|
||
|
loop = get_hub().loop
|
||
|
loop.run_callback(incr)
|
||
|
loop.run()
|
||
|
self.assertEqual(count, [1])
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
greentest.main()
|