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

Function test_file_single_quote

tests/test_magic.py:1291–1308  ·  view source on GitHub ↗

Basic %%writefile with embedded single quotes

()

Source from the content-addressed store, hash-verified

1289
1290@dec.skip_win32
1291def test_file_single_quote():
1292 """Basic %%writefile with embedded single quotes"""
1293 ip = get_ipython()
1294 with TemporaryDirectory() as td:
1295 fname = os.path.join(td, "'file1'")
1296 ip.run_cell_magic(
1297 "writefile",
1298 fname,
1299 "\n".join(
1300 [
1301 "line1",
1302 "line2",
1303 ]
1304 ),
1305 )
1306 s = Path(fname).read_text(encoding="utf-8")
1307 assert "line1\n" in s
1308 assert "line2" in s
1309
1310
1311@dec.skip_win32

Callers

nothing calls this directly

Calls 2

get_ipythonFunction · 0.90
run_cell_magicMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…