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

Method test_ipy_script_file_attribute

tests/test_shellapp.py:35–41  ·  view source on GitHub ↗

Test that `__file__` is set when running `ipython file.ipy`

(self)

Source from the content-addressed store, hash-verified

33 tt.ipexec_validate(self.fname, self.fname, err)
34
35 def test_ipy_script_file_attribute(self):
36 """Test that `__file__` is set when running `ipython file.ipy`"""
37 src = "print(__file__)\n"
38 self.mktmp(src, ext=".ipy")
39
40 err = None
41 tt.ipexec_validate(self.fname, self.fname, err)
42
43 # The commands option to ipexec_validate doesn't work on Windows, and it
44 # doesn't seem worth fixing

Callers

nothing calls this directly

Calls 1

mktmpMethod · 0.80

Tested by

no test coverage detected