()
| 1913 | |
| 1914 | |
| 1915 | def test_lazy_magics(): |
| 1916 | with pytest.raises(UsageError): |
| 1917 | ip.run_line_magic("lazy_line", "") |
| 1918 | |
| 1919 | startdir = os.getcwd() |
| 1920 | |
| 1921 | with TemporaryDirectory() as tmpdir: |
| 1922 | with prepended_to_syspath(tmpdir): |
| 1923 | ptempdir = Path(tmpdir) |
| 1924 | tf = ptempdir / "lazy_magic_module.py" |
| 1925 | tf.write_text(MINIMAL_LAZY_MAGIC) |
| 1926 | ip.magics_manager.register_lazy("lazy_line", Path(tf.name).name[:-3]) |
| 1927 | with tt.AssertPrints("Lazy Line"): |
| 1928 | ip.run_line_magic("lazy_line", "") |
| 1929 | |
| 1930 | |
| 1931 | TEST_MODULE = """ |
nothing calls this directly
no test coverage detected
searching dependent graphs…