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

Method test_py_script_file_attribute

tests/test_shellapp.py:27–33  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

25 """Test the behavior of the file_to_run parameter."""
26
27 def test_py_script_file_attribute(self):
28 """Test that `__file__` is set when running `ipython file.py`"""
29 src = "print(__file__)\n"
30 self.mktmp(src)
31
32 err = None
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`"""

Callers

nothing calls this directly

Calls 1

mktmpMethod · 0.80

Tested by

no test coverage detected