MCPcopy Index your code
hub / github.com/ipython/ipython / test_get_py_filename

Function test_get_py_filename

tests/test_path.py:323–338  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

321
322@with_environment
323def test_get_py_filename():
324 os.chdir(TMP_TEST_DIR)
325 with make_tempfile("foo.py"):
326 assert path.get_py_filename("foo.py") == "foo.py"
327 assert path.get_py_filename("foo") == "foo.py"
328 with make_tempfile("foo"):
329 assert path.get_py_filename("foo") == "foo"
330 pytest.raises(IOError, path.get_py_filename, "foo.py")
331 pytest.raises(IOError, path.get_py_filename, "foo")
332 pytest.raises(IOError, path.get_py_filename, "foo.py")
333 true_fn = "foo with spaces.py"
334 with make_tempfile(true_fn):
335 assert path.get_py_filename("foo with spaces") == true_fn
336 assert path.get_py_filename("foo with spaces.py") == true_fn
337 pytest.raises(IOError, path.get_py_filename, '"foo with spaces.py"')
338 pytest.raises(IOError, path.get_py_filename, "'foo with spaces.py'")
339
340
341@onlyif_unicode_paths

Callers

nothing calls this directly

Calls 1

make_tempfileFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…