(self)
| 663 | self.assertEqual(called, {-2, -3}) |
| 664 | |
| 665 | def test_time(self): |
| 666 | called = [] |
| 667 | def f(x): |
| 668 | called.append(x) |
| 669 | ip.push({'f':f}) |
| 670 | |
| 671 | # Test with an expression |
| 672 | with tt.AssertPrints("Wall time: "): |
| 673 | ip.run_line_magic("time", "f(5+9)") |
| 674 | self.assertEqual(called, [-14]) |
| 675 | called[:] = [] |
| 676 | |
| 677 | # Test with a statement (different code path) |
| 678 | with tt.AssertPrints("Wall time: "): |
| 679 | ip.run_line_magic("time", "a = f(-3 + -2)") |
| 680 | self.assertEqual(called, [5]) |
| 681 | |
| 682 | def test_macro(self): |
| 683 | ip.push({'a':10}) |
nothing calls this directly
no test coverage detected