本文整理汇总了Python中test_support.run_unittest函数的典型用法代码示例。如果您正苦于以下问题:Python run_unittest函数的具体用法?Python run_unittest怎么用?Python run_unittest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了run_unittest函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
def main():
test_support.run_unittest(LockTests, RLockTests, EventTests,
ConditionAsRLockTests, ConditionTests,
SemaphoreTests, BoundedSemaphoreTests,
ThreadTests,
ThreadJoinOnShutdown,
ThreadingExceptionTests,
)
示例2: test_main
def test_main(verbose=None):
NamedTupleDocs = doctest.DocTestSuite(module=collections)
test_classes = [
TestNamedTuple,
NamedTupleDocs,
TestOneTrickPonyABCs,
TestCollectionABCs,
TestCounter,
TestOrderedDict,
GeneralMappingTests,
SubclassMappingTests,
]
test_support.run_unittest(*test_classes)
test_support.run_doctest(collections, verbose)
示例3: test_main
def test_main(verbose=None):
import sys
test_classes = (TestBasic, TestVariousIteratorArgs, TestSubclass, TestSubclassWithKwargs)
test_support.run_unittest(*test_classes)
# verify reference counting
if verbose and hasattr(sys, "gettotalrefcount"):
import gc
counts = [None] * 5
for i in xrange(len(counts)):
test_support.run_unittest(*test_classes)
gc.collect()
counts[i] = sys.gettotalrefcount()
print counts
# doctests
import test_deque
test_support.run_doctest(test_deque, verbose)
示例4: test_main
def test_main():
import sys
test_support.run_unittest(TestSubclasses)
示例5: test_main
def test_main():
test_support.run_unittest(MessageTestCase)
示例6: test_main
def test_main():
test_support.run_unittest(ImportHooksTestCase)
示例7: test_main
def test_main():
test_support.run_unittest(QueueTest, LifoQueueTest, PriorityQueueTest,
FailingQueueTest)
示例8: test_main
def test_main():
run_unittest(CommandTests)
示例9: trace
old = None
lst = []
try:
def trace(frame, ev, arg):
lst.append((frame.f_code.co_filename, frame.f_lineno, ev))
six.print_("TRACE: %s:%s %s" % lst[-1])
return trace
with gevent.thread.allocate_lock():
sys.settrace(trace)
finally:
sys.settrace(old)
self.failUnless(lst == [], "trace not empty")
def run_script(self, more_args=[]):
rc = subprocess.call([sys.executable, "-c", script] + more_args)
self.failIf(rc == 2, "interpreter was blocked")
self.failUnless(rc == 0, "Unexpected error")
def test_finalize_with_trace(self):
self.run_script()
def test_bootstrap_inner_with_trace(self):
self.run_script(["1"])
if __name__ == "__main__":
import test_support
test_support.run_unittest(ThreadTrace)
示例10: test_main
def test_main():
test_support.run_unittest(JreloadTestCase)
示例11: test_main
def test_main():
run_unittest(CodeopTests)
示例12: testall
def testall():
test_support.run_unittest(Test)
示例13: test_main
def test_main():
run_unittest(GlobTests)
示例14: NetrcTestCase
default login log2 password pass2
"""
temp_filename = tempfile.mktemp()
class NetrcTestCase(unittest.TestCase):
def setUp (self):
fp = open(temp_filename, 'wt')
fp.write(TEST_NETRC)
fp.close()
self.netrc = netrc.netrc(temp_filename)
def tearDown (self):
del self.netrc
os.unlink(temp_filename)
def test_case_1(self):
self.assert_(self.netrc.macros == {'macro1':['line1\n', 'line2\n'],
'macro2':['line3\n', 'line4\n']}
)
self.assert_(self.netrc.hosts['foo'] == ('log1', 'acct1', 'pass1'))
self.assert_(self.netrc.hosts['default'] == ('log2', None, 'pass2'))
if __name__ == "__main__":
test_support.run_unittest(NetrcTestCase)
示例15: test_main
def test_main():
run_unittest(MhlibTests)