(const1, const2)
| 999 | # but have a different type. |
| 1000 | |
| 1001 | def check_different_constants(const1, const2): |
| 1002 | ns = {} |
| 1003 | exec("f1, f2 = lambda: %r, lambda: %r" % (const1, const2), ns) |
| 1004 | f1 = ns['f1'] |
| 1005 | f2 = ns['f2'] |
| 1006 | self.assertIsNot(f1.__code__, f2.__code__) |
| 1007 | self.assertNotEqual(f1.__code__, f2.__code__) |
| 1008 | self.check_constant(f1, const1) |
| 1009 | self.check_constant(f2, const2) |
| 1010 | self.assertEqual(repr(f1()), repr(const1)) |
| 1011 | self.assertEqual(repr(f2()), repr(const2)) |
| 1012 | |
| 1013 | check_different_constants(+0.0, -0.0) |
| 1014 | check_different_constants((0,), (0.0,)) |
nothing calls this directly
no test coverage detected