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