core: loosen assertion to allow fakessh_test to succeed.

This commit is contained in:
David Wilson 2017-10-01 15:29:04 +05:30
parent bc801bc2ed
commit 2454dcc990
2 changed files with 29 additions and 1 deletions

View File

@ -763,7 +763,7 @@ class Context(object):
def _unpickle_context(router, context_id, name):
assert isinstance(router, Router)
assert isinstance(context_id, (int, long)) and context_id > 0
assert type(name) is str and len(name) < 100
assert isinstance(name, basestring) and len(name) < 100
return Context(router, context_id, name)

View File

@ -0,0 +1,28 @@
import unittest
import mitogen.master
class CompilerModuleTest(unittest.TestCase):
klass = mitogen.master.ModuleScanner
@classmethod
def setUpClass(cls):
super(CompilerModuleTest, cls).setUpClass()
#import compiler
#mitogen.master.ast = None
#mitogen.master.compiler = compiler
def test_simple(self):
for x in range(100):
finder = self.klass()
from pprint import pprint
import time
t0 = time.time()
import mitogen.fakessh
pprint(finder.find_related('mitogen.fakessh'))
print 1000 * (time.time() - t0)
if __name__ == '__main__':
unittest.main()