def test_main(): tests = [HelperFunctionTests, DispatcherTests, DispatcherWithSendTests, DispatcherWithSendTests_UsePoll, FileWrapperTest, TestAPI_UseIPv4Select, TestAPI_UseIPv4Poll, TestAPI_UseIPv6Select, TestAPI_UseIPv6Poll, TestAPI_UseUnixSocketsSelect, TestAPI_UseUnixSocketsPoll] run_unittest(*tests)
def test_main(verbose=None): import sys test_classes = ( TestBasic, TestVariousIteratorArgs, TestSubclass, TestSubclassWithKwargs, TestSequence, ) support.run_unittest(*test_classes) # verify reference counting if verbose and hasattr(sys, "gettotalrefcount"): import gc counts = [None] * 5 for i in range(len(counts)): support.run_unittest(*test_classes) gc.collect() counts[i] = sys.gettotalrefcount() print(counts) # doctests from test import test_deque support.run_doctest(test_deque, verbose)
def test_main(): support.run_unittest(CAPITest, TestPendingCalls, Test6012, EmbeddingTest, SkipitemTest) for name in dir(_testcapi): if name.startswith('test_'): test = getattr(_testcapi, name) if support.verbose: print("internal", name) test() # some extra thread-state tests driven via _testcapi def TestThreadState(): if support.verbose: print("auto-thread-state") idents = [] def callback(): idents.append(threading.get_ident()) _testcapi._test_thread_state(callback) a = b = callback time.sleep(1) # Check our main thread is in the list exactly 3 times. if idents.count(threading.get_ident()) != 3: raise support.TestFailed( "Couldn't find main thread correctly in the list") if threading: import time TestThreadState() t = threading.Thread(target=TestThreadState) t.start() t.join()
def test_main(): support.requires('network') support.run_unittest( CreationTestCase, TCPTimeoutTestCase, UDPTimeoutTestCase, )
def test_main(): support.run_unittest(XMLRPCTestCase, HelperTestCase, DateTimeTestCase, BinaryTestCase, FaultTestCase, UseBuiltinTypesTestCase, SimpleServerTestCase, KeepaliveServerTestCase1, KeepaliveServerTestCase2, GzipServerTestCase, MultiPathServerTestCase, ServerProxyTestCase, FailingServerTestCase, CGIHandlerTestCase)
def test_main(): run_unittest(MakeParserTest, SaxutilsTest, XmlgenTest, ExpatReaderTest, ErrorReportingTest, XmlReaderTest)
def test_main(): support.run_unittest( OSEINTRTest, SocketEINTRTest, TimeEINTRTest, SignalEINTRTest, SelectEINTRTest)
def test_main(): support.run_unittest( TimeTestCase, TestLocale, TestAsctime4dyear, TestStrftime4dyear, TestPytime)
def test_main(): support.run_unittest( TestTracemallocEnabled, TestSnapshot, TestFilters, TestCommandLine, )
def test_main(): support.requires("network") support.run_unittest(AuthTests, OtherNetworkTests, CloseSocketTest, TimeoutTest, )
def test_main(): support.requires('network') with support.check_py3k_warnings( ("urllib.urlopen.. has been removed", DeprecationWarning)): support.run_unittest(URLTimeoutTest, urlopenNetworkTests, urlretrieveNetworkTests)
def test_main(): tests = [ PickleTests, PyUnpicklerTests, PyPicklerTests, PyPersPicklerTests, PyDispatchTableTests, PyChainDispatchTableTests, CompatPickleTests, ] if has_c_implementation: tests.extend( [ CUnpicklerTests, CPicklerTests, CPersPicklerTests, CDumpPickle_LoadPickle, DumpPickle_CLoadPickle, PyPicklerUnpicklerObjectTests, CPicklerUnpicklerObjectTests, CDispatchTableTests, CChainDispatchTableTests, InMemoryPickleTests, SizeofTests, ] ) support.run_unittest(*tests) support.run_doctest(pickle)
def test_main(): support.run_unittest( ConfigParserTestCase, RawConfigParserTestCase, SafeConfigParserTestCase, SortedTestCase )
def test_main(): from test import support support.run_unittest( ModuleForLoaderTests, SetPackageTests, ResolveNameTests )
def test_main(): support.run_unittest( ChecksumTestCase, ExceptionTestCase, CompressTestCase, CompressObjectTestCase )
def test_main(verbose=False): if skip_expected: raise unittest.SkipTest("No SSL support") global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "keycert.pem") SVN_PYTHON_ORG_ROOT_CERT = os.path.join( os.path.dirname(__file__) or os.curdir, "https_svn_python_org_root.pem") if (not os.path.exists(CERTFILE) or not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT)): raise support.TestFailed("Can't read certificate files!") tests = [BasicTests] if support.is_resource_enabled('network'): tests.append(NetworkedTests) if _have_threads: thread_info = support.threading_setup() if thread_info and support.is_resource_enabled('network'): tests.append(ThreadedTests) support.run_unittest(*tests) if _have_threads: support.threading_cleanup(*thread_info)
def test_main(): support.run_unittest(Frozen_ModuleLockAsRLockTests, Source_ModuleLockAsRLockTests, Frozen_DeadlockAvoidanceTests, Source_DeadlockAvoidanceTests, Frozen_LifetimeTests, Source_LifetimeTests)
def test_main(verbose=None): testclasses = [WichmannHill_TestBasicOps, MersenneTwister_TestBasicOps, TestDistributions, TestModule] if support.is_jython: del MersenneTwister_TestBasicOps.test_genrandbits del MersenneTwister_TestBasicOps.test_referenceImplementation del MersenneTwister_TestBasicOps.test_setstate_middle_arg del MersenneTwister_TestBasicOps.test_strong_reference_implementation try: random.SystemRandom().random() except NotImplementedError: pass else: testclasses.append(SystemRandom_TestBasicOps) support.run_unittest(*testclasses) # verify reference counting import sys if verbose and hasattr(sys, "gettotalrefcount"): counts = [None] * 5 for i in range(len(counts)): support.run_unittest(*testclasses) counts[i] = sys.gettotalrefcount() print(counts)
def test_main(verbose=None): NamedTupleDocs = doctest.DocTestSuite(module=collections) test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs, TestCollectionABCs, TestCounter, TestOrderedDict, GeneralMappingTests, SubclassMappingTests] support.run_unittest(*test_classes) support.run_doctest(collections, verbose)
def test_main(): tests = [ ChdirTestCase, ImportTestCase, ImportPackageTestCase, ZipimportTestCase, PyCompileTestCase, ExecfileTestCase, ExecfileTracebackTestCase, ListdirTestCase, DirsTestCase, FilesTestCase, SymlinkTestCase ] if WINDOWS: tests.append(WindowsChdirTestCase) tests.remove(SymlinkTestCase) # os.symlink ... Availability: Unix. if support.is_jython: tests.extend((ImportJavaClassTestCase, ImportJarTestCase)) if support.is_resource_enabled('subprocess'): tests.append(SubprocessTestCase) support.run_unittest(*tests)
def test_main(): try: support.run_unittest(BasicSignalTests, InterProcessSignalTests, WakeupSignalTests, SiginterruptTest, ItimerTest, WindowsSignalTests) finally: support.reap_children()
def test_main(verbose=None): run_unittest(ImportTests, PycacheTests, FilePermissionTests, PycRewritingTests, PathsTests, RelativeImportTests, OverridingImportBuiltinTests, ImportlibBootstrapTests, TestSymbolicallyLinkedPackage, ImportTracebackTests)
def test_main(): support.run_unittest( TestVectorsTestCase, ConstructorTestCase, SanityTestCase, CopyTestCase )
def test_main(verbose=None): from test import test_code run_doctest(test_code, verbose) tests = [CodeTest, CodeConstsTest, CodeWeakRefTest] if check_impl_detail(cpython=True) and ctypes is not None: tests.append(CoExtra) run_unittest(*tests)
def test_main(): support.run_unittest( OutputTestCase, CalendarTestCase, MondayTestCase, SundayTestCase )
def test_main(): support.run_unittest( TestCRNewlines, TestLFNewlines, TestCRLFNewlines, TestMixedNewlines )
def test_main(): tests = [HelperFunctionTests, DispatcherTests, DispatcherWithSendTests, DispatcherWithSendTests_UsePoll] if hasattr(asyncore, 'file_wrapper'): tests.append(FileWrapperTest) run_unittest(*tests)
def test_main(verbose=None): test_classes = ( TestPartialC, TestPartialPy, TestPartialCSubclass, TestUpdateWrapper, TestTotalOrdering, TestCmpToKeyC, TestCmpToKeyPy, TestWraps, TestReduce, TestLRU, TestSingleDispatch, ) support.run_unittest(*test_classes) # verify reference counting if verbose and hasattr(sys, "gettotalrefcount"): import gc counts = [None] * 5 for i in range(len(counts)): support.run_unittest(*test_classes) gc.collect() counts[i] = sys.gettotalrefcount() print(counts)
def test_main(): run_unittest(FailureTestCase, NonexceptionalTestCase, NestedNonexceptionalTestCase, ExceptionalTestCase, NonLocalFlowControlTestCase, AssignmentTargetTestCase, ExitSwallowsExceptionTestCase, NestedWith)
def test_main(): from doctest import DocFileSuite suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(MathTests)) suite.addTest(DocFileSuite("ieee754.txt")) run_unittest(suite)
def test_main(): run_unittest(NormalizationTest)
self.assertEqual(cmd.include_dirs, ['one', 'two']) self.assertEqual(cmd.libraries, ['one']) self.assertEqual(cmd.library_dirs, ['three', 'four']) def test_clean(self): # _clean removes files tmp_dir = self.mkdtemp() f1 = os.path.join(tmp_dir, 'one') f2 = os.path.join(tmp_dir, 'two') self.write_file(f1, 'xxx') self.write_file(f2, 'xxx') for f in (f1, f2): self.assertTrue(os.path.exists(f)) pkg_dir, dist = self.create_dist() cmd = config(dist) cmd._clean(f1, f2) for f in (f1, f2): self.assertFalse(os.path.exists(f)) def test_suite(): return unittest.makeSuite(ConfigTestCase) if __name__ == "__main__": run_unittest(test_suite())
def test_main(): run_unittest(KeywordOnlyArgTestCase)
def test_main(): support.run_unittest(FunctionPropertiesTest, InstancemethodAttrTest, ArbitraryFunctionAttrTest, FunctionDictsTest, FunctionDocstringTest, CellTest, StaticMethodAttrsTest, BuiltinFunctionPropertiesTest)
def test_main(): run_unittest(TestFilemode)
def test_main(): support.run_unittest(WrapTestCase, LongWordTestCase, IndentTestCases, DedentTestCase)
def test_main(): support.run_unittest(TestCase)
def test_main(): run_unittest(FractionTest, GcdTest)
def test_main(): from test.support import run_unittest run_unittest(SimpleTest, SourceLoaderBadBytecodeTest, SourcelessLoaderBadBytecodeTest)
def test_main(): tests = [TestSupport] support.run_unittest(*tests)
def test_main(): support.run_unittest(TestCalendar, TestSQL, TestTimezone)
def test_main(): support.run_unittest(__name__)
def test_main(): run_unittest(TestGdbm)
def test_unicode(self): adict = {'opt': 'välúè'} self.assertEqual(ttk.tclobjs_to_py(adict), {'opt': 'välúè'}) adict['opt'] = MockTclObj(adict['opt']) self.assertEqual(ttk.tclobjs_to_py(adict), {'opt': 'välúè'}) def test_multivalues(self): adict = {'opt': [1, 2, 3, 4]} self.assertEqual(ttk.tclobjs_to_py(adict), {'opt': [1, 2, 3, 4]}) adict['opt'] = [1, 'xm', 3] self.assertEqual(ttk.tclobjs_to_py(adict), {'opt': [1, 'xm', 3]}) adict['opt'] = (MockStateSpec('a', 'b'), 'válũè') self.assertEqual(ttk.tclobjs_to_py(adict), {'opt': [('a', 'b', 'válũè')]}) self.assertEqual(ttk.tclobjs_to_py({'x': ['y z']}), {'x': ['y z']}) def test_nosplit(self): self.assertEqual(ttk.tclobjs_to_py({'text': 'some text'}), {'text': 'some text'}) tests_nogui = (InternalFunctionsTest, TclObjsToPyTest) if __name__ == "__main__": from test.support import run_unittest run_unittest(*tests_nogui)
def test_main(): support.run_unittest( *runtktests.get_tests(text=False, packages=['test_ttk']))
def test_main(): for module in dbm_iterator(): support.run_unittest(TestAsciiFileShelve, TestBinaryFileShelve, TestProto2FileShelve, TestAsciiMemShelve, TestBinaryMemShelve, TestProto2MemShelve, TestCase)
def test_main(): run_unittest(TokenTests, GrammarTests)
def test_main(): run_unittest(AIFCTest) run_unittest(AIFCLowLevelTest)
def test_main(): support.run_unittest(TestDefaultDict)
def test_main(verbose=None): support.run_unittest(TestGzip, TestOpen, TestCommandLine)
def test_main(): support.run_unittest(LineCacheTests)
def test_main(): run_unittest(TestSysConfig, MakefileTests)
def test_main(): support.run_unittest(CmdLineTest, IgnoreEnvironmentTest) support.reap_children()
) dist = Distribution({ 'name': 'deptarget', 'ext_modules': [deptarget_ext] }) dist.package_dir = self.tmp_dir cmd = build_ext(dist) cmd.build_lib = self.tmp_dir cmd.build_temp = self.tmp_dir try: old_stdout = sys.stdout if not support.verbose: # silence compiler output sys.stdout = StringIO() try: cmd.ensure_finalized() cmd.run() finally: sys.stdout = old_stdout except CompileError: self.fail("Wrong deployment target during compilation") def test_suite(): return unittest.makeSuite(BuildExtTestCase) if __name__ == '__main__': support.run_unittest(test_suite())
def test_main(): support.run_unittest(StringprepTests)
def test_main(): support.run_unittest(*test_classes)
def test_main(): support.run_unittest(ModuleFinderTest)
def test_main(): run_unittest(SunAUTest)
def test_main(): support.run_unittest(zos_load_test_case)
def test_main(): support.run_unittest(StructSeqTest)