Show More
@@ -38,9 +38,11 from IPython.utils.syspathcontext import prepended_to_syspath | |||
|
38 | 38 | # import needed by doctest |
|
39 | 39 | from .test_debugger import PdbTestInput # noqa: F401 |
|
40 | 40 | |
|
41 | _ip = get_ipython() | |
|
41 | 42 | |
|
42 | 43 | @magic.magics_class |
|
43 |
class DummyMagics(magic.Magics): |
|
|
44 | class DummyMagics(magic.Magics): | |
|
45 | pass | |
|
44 | 46 | |
|
45 | 47 | def test_extract_code_ranges(): |
|
46 | 48 | instr = "1 3 5-6 7-9 10:15 17: :10 10- -13 :" |
@@ -476,13 +478,13 def test_time_no_output_with_semicolon(): | |||
|
476 | 478 | |
|
477 | 479 | |
|
478 | 480 | def test_time_last_not_expression(): |
|
479 | ip.run_cell("%%time\n" | |
|
481 | _ip.run_cell("%%time\n" | |
|
480 | 482 | "var_1 = 1\n" |
|
481 | 483 | "var_2 = 2\n") |
|
482 | assert ip.user_ns['var_1'] == 1 | |
|
483 | del ip.user_ns['var_1'] | |
|
484 | assert ip.user_ns['var_2'] == 2 | |
|
485 | del ip.user_ns['var_2'] | |
|
484 | assert _ip.user_ns['var_1'] == 1 | |
|
485 | del _ip.user_ns['var_1'] | |
|
486 | assert _ip.user_ns['var_2'] == 2 | |
|
487 | del _ip.user_ns['var_2'] | |
|
486 | 488 | |
|
487 | 489 | |
|
488 | 490 | @dec.skip_win32 |
@@ -964,7 +966,7 class CellMagicTestCase(TestCase): | |||
|
964 | 966 | self.check_ident('cellm4') |
|
965 | 967 | # Check that nothing is registered as 'cellm33' |
|
966 | 968 | c33 = _ip.find_cell_magic('cellm33') |
|
967 |
assert c33 |
|
|
969 | assert c33 is None | |
|
968 | 970 | |
|
969 | 971 | def test_file(): |
|
970 | 972 | """Basic %%writefile""" |
@@ -1097,7 +1099,7 def test_file_amend(): | |||
|
1097 | 1099 | def test_file_spaces(): |
|
1098 | 1100 | """%%file with spaces in filename""" |
|
1099 | 1101 | ip = get_ipython() |
|
1100 |
with TemporaryWorkingDirectory() |
|
|
1102 | with TemporaryWorkingDirectory(): | |
|
1101 | 1103 | fname = "file name" |
|
1102 | 1104 | ip.run_cell_magic( |
|
1103 | 1105 | "file", |
@@ -1502,18 +1504,16 def load_ipython_extension(ipython): | |||
|
1502 | 1504 | |
|
1503 | 1505 | def test_lazy_magics(): |
|
1504 | 1506 | with pytest.raises(UsageError): |
|
1505 | ip.run_line_magic("lazy_line", "") | |
|
1506 | ||
|
1507 | startdir = os.getcwd() | |
|
1507 | _ip.run_line_magic("lazy_line", "") | |
|
1508 | 1508 | |
|
1509 | 1509 | with TemporaryDirectory() as tmpdir: |
|
1510 | 1510 | with prepended_to_syspath(tmpdir): |
|
1511 | 1511 | ptempdir = Path(tmpdir) |
|
1512 | 1512 | tf = ptempdir / "lazy_magic_module.py" |
|
1513 | 1513 | tf.write_text(MINIMAL_LAZY_MAGIC) |
|
1514 | ip.magics_manager.register_lazy("lazy_line", Path(tf.name).name[:-3]) | |
|
1514 | _ip.magics_manager.register_lazy("lazy_line", Path(tf.name).name[:-3]) | |
|
1515 | 1515 | with tt.AssertPrints("Lazy Line"): |
|
1516 | ip.run_line_magic("lazy_line", "") | |
|
1516 | _ip.run_line_magic("lazy_line", "") | |
|
1517 | 1517 | |
|
1518 | 1518 | |
|
1519 | 1519 | TEST_MODULE = """ |
@@ -90,6 +90,7 def ghissue_role(name, rawtext, text, lineno, inliner, options=None, content=Non | |||
|
90 | 90 | '"%s" is invalid.' % name, line=lineno) |
|
91 | 91 | prb = inliner.problematic(rawtext, rawtext, msg) |
|
92 | 92 | return [prb], [msg] |
|
93 | app = inliner.document.settings.env.app | |
|
93 | 94 | node = make_link_node(rawtext, app, category, str(issue_num), options) |
|
94 | 95 | return [node], [] |
|
95 | 96 |
General Comments 0
You need to be logged in to leave comments.
Login now