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

Method test_run_module

Lib/test/test_cmd_line.py:192–202  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

190 self.assertRegex(res.out.decode('utf-8'), expected)
191
192 def test_run_module(self):
193 # Test expected operation of the '-m' switch
194 # Switch needs an argument
195 assert_python_failure('-m')
196 # Check we get an error for a nonexistent module
197 assert_python_failure('-m', 'fnord43520xyz')
198 # Check the runpy module also gives an error for
199 # a nonexistent module
200 assert_python_failure('-m', 'runpy', 'fnord43520xyz')
201 # All good if module is located and run successfully
202 assert_python_ok('-m', 'timeit', '-n', '1')
203
204 def test_run_module_bug1764407(self):
205 # -m and -i need to play well together

Callers

nothing calls this directly

Calls 2

assert_python_failureFunction · 0.90
assert_python_okFunction · 0.90

Tested by

no test coverage detected