%%writefile with unicode cell
()
| 1351 | |
| 1352 | |
| 1353 | def test_file_unicode(): |
| 1354 | """%%writefile with unicode cell""" |
| 1355 | ip = get_ipython() |
| 1356 | with TemporaryDirectory() as td: |
| 1357 | fname = os.path.join(td, "file1") |
| 1358 | ip.run_cell_magic( |
| 1359 | "writefile", |
| 1360 | fname, |
| 1361 | "\n".join( |
| 1362 | [ |
| 1363 | "liné1", |
| 1364 | "liné2", |
| 1365 | ] |
| 1366 | ), |
| 1367 | ) |
| 1368 | with io.open(fname, encoding="utf-8") as f: |
| 1369 | s = f.read() |
| 1370 | assert "liné1\n" in s |
| 1371 | assert "liné2" in s |
| 1372 | |
| 1373 | |
| 1374 | def test_file_amend(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…