(self)
| 799 | self.assertEqual(called, {-2, -3}) |
| 800 | |
| 801 | def test_time(self): |
| 802 | called = [] |
| 803 | |
| 804 | def f(x): |
| 805 | called.append(x) |
| 806 | |
| 807 | ip.push({"f": f}) |
| 808 | |
| 809 | # Test with an expression |
| 810 | with tt.AssertPrints("Wall time: "): |
| 811 | ip.run_line_magic("time", "f(5+9)") |
| 812 | self.assertEqual(called, [-14]) |
| 813 | called[:] = [] |
| 814 | |
| 815 | # Test with a statement (different code path) |
| 816 | with tt.AssertPrints("Wall time: "): |
| 817 | ip.run_line_magic("time", "a = f(-3 + -2)") |
| 818 | self.assertEqual(called, [5]) |
| 819 | |
| 820 | def test_macro(self): |
| 821 | ip.push({"a": 10}) |
nothing calls this directly
no test coverage detected