summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2020-03-03 09:37:42 +0100
committerClaudiu Popa <pcmanticore@gmail.com>2020-03-03 10:04:49 +0100
commit7b7c55c0fa8b2c51a5a514a6a3aa802e1da7a08c (patch)
tree649a81f7bdcdfcd0eaa6e44e977398608d7f2431 /tests
parente3fcf35eb669df8dc6d8bbbebaf8a9cec6498f95 (diff)
downloadastroid-git-7b7c55c0fa8b2c51a5a514a6a3aa802e1da7a08c.tar.gz
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/unittest_inference.py4
1 files changed, 3 insertions, 1 deletions
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 = """