本文整理汇总了Python中tests.aspects.unittest.main函数的典型用法代码示例。如果您正苦于以下问题:Python main函数的具体用法?Python main怎么用?Python main使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了main函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: LiteralTests
"""__unicode__ should return type unicode."""
self.assertIsInstance(self.object_under_test.__unicode__(), UnicodeType)
class LiteralTests(Shared.SparqlNodeTests):
"""Tests for sparql.Literal."""
net = False
object_under_test = sparql.Literal({'datatype': '', 'lang': 'en', 'value': 'value'})
class BnodeTests(Shared.SparqlNodeTests):
"""Tests for sparql.Bnode."""
net = False
object_under_test = sparql.Bnode({'value': 'Foo'})
class URITests(Shared.SparqlNodeTests):
"""Tests for sparql.URI."""
net = False
object_under_test = sparql.URI({'value': 'http://foo.com'}, 'http://bar.com')
if __name__ == '__main__': # pragma: no cover
try:
unittest.main()
except SystemExit:
pass
示例2: TestPwb
class TestPwb(PwbTestCase):
"""
Test pwb.py functionality.
This is registered as a Site test because it will not run
without a user-config.py
"""
# site must be explicitly set for pwb tests. This test does not require
# network access, because tests/pwb/print_locals.py does not use
# handle_args, etc. so version.py doesnt talk on the network.
site = False
net = False
def testScriptEnvironment(self):
"""
Test environment of pywikibot.
Make sure the environment is not contaminated, and is the same as
the environment we get when directly running a script.
"""
direct = execute([sys.executable, '-m', 'tests.pwb.print_locals'])
vpwb = execute_pwb([print_locals_test_script])
self.maxDiff = None
self.assertEqual(direct['stdout'], vpwb['stdout'])
if __name__ == "__main__":
unittest.main(verbosity=10)