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

Method test_script_abspath

Lib/test/test_cmd_line_script.py:228–238  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

226 expected_cwd=script_dir)
227
228 def test_script_abspath(self):
229 # pass the script using the relative path, expect the absolute path
230 # in __file__
231 with os_helper.temp_cwd() as script_dir:
232 self.assertTrue(os.path.isabs(script_dir), script_dir)
233
234 script_name = _make_test_script(script_dir, 'script')
235 relative_name = os.path.basename(script_name)
236 self._check_script(relative_name, script_name, relative_name,
237 script_dir, None,
238 importlib.machinery.SourceFileLoader)
239
240 def test_script_compiled(self):
241 with os_helper.temp_dir() as script_dir:

Callers

nothing calls this directly

Calls 5

_check_scriptMethod · 0.95
assertTrueMethod · 0.80
_make_test_scriptFunction · 0.70
isabsMethod · 0.45
basenameMethod · 0.45

Tested by

no test coverage detected