MCPcopy Index your code
hub / github.com/python/cpython / __init__

Method __init__

Lib/unittest/main.py:66–104  ·  view source on GitHub ↗
(self, module='__main__', defaultTest=None, argv=None,
                    testRunner=None, testLoader=loader.defaultTestLoader,
                    exit=True, verbosity=1, failfast=None, catchbreak=None,
                    buffer=None, warnings=None, *, tb_locals=False,
                    durations=None)

Source from the content-addressed store, hash-verified

64 _discovery_parser = None
65
66 def __init__(self, module='__main__', defaultTest=None, argv=None,
67 testRunner=None, testLoader=loader.defaultTestLoader,
68 exit=True, verbosity=1, failfast=None, catchbreak=None,
69 buffer=None, warnings=None, *, tb_locals=False,
70 durations=None):
71 if isinstance(module, str):
72 self.module = __import__(module)
73 for part in module.split('.')[1:]:
74 self.module = getattr(self.module, part)
75 else:
76 self.module = module
77 if argv is None:
78 argv = sys.argv
79
80 self.exit = exit
81 self.failfast = failfast
82 self.catchbreak = catchbreak
83 self.verbosity = verbosity
84 self.buffer = buffer
85 self.tb_locals = tb_locals
86 self.durations = durations
87 if warnings is None and not sys.warnoptions:
88 # even if DeprecationWarnings are ignored by default
89 # print them anyway unless other warnings settings are
90 # specified by the warnings arg or the -W python flag
91 self.warnings = 'default'
92 else:
93 # here self.warnings is set either to the value passed
94 # to the warnings args or to None.
95 # If the user didn't pass a value self.warnings will
96 # be None. This means that the behavior is unchanged
97 # and depends on the values passed to -W.
98 self.warnings = warnings
99 self.defaultTest = defaultTest
100 self.testRunner = testRunner
101 self.testLoader = testLoader
102 self.progName = os.path.basename(argv[0])
103 self.parseArgs(argv)
104 self.runTests()
105
106 def _print_help(self, *args, **kwargs):
107 if self.module is None:

Callers

nothing calls this directly

Calls 5

parseArgsMethod · 0.95
runTestsMethod · 0.95
__import__Function · 0.85
splitMethod · 0.45
basenameMethod · 0.45

Tested by

no test coverage detected