Basic %%writefile with embedded single quotes
()
| 1289 | |
| 1290 | @dec.skip_win32 |
| 1291 | def 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 |
nothing calls this directly
no test coverage detected
searching dependent graphs…