From 7b7c55c0fa8b2c51a5a514a6a3aa802e1da7a08c Mon Sep 17 00:00:00 2001 From: Claudiu Popa Date: Tue, 3 Mar 2020 09:37:42 +0100 Subject: Verify the existence of datetime and date in ancestors instead of object `object` cannot be inferred as an ancestor of datetime.date on PyPy, due to a base class that is not inferrable. --- tests/unittest_inference.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/unittest_inference.py b/tests/unittest_inference.py index 83dfcfb5..91a14ec6 100644 --- a/tests/unittest_inference.py +++ b/tests/unittest_inference.py @@ -1701,7 +1701,9 @@ class InferenceTest(resources.SysPathSetup, unittest.TestCase): pass """ ) - self.assertIn("object", [base.name for base in klass.ancestors()]) + ancestors = [base.name for base in klass.ancestors()] + expected_subset = ["datetime", "date"] + self.assertEqual(expected_subset, ancestors[:2]) def test_stop_iteration_leak(self): code = """ -- cgit v1.2.1