Skip to content

Commit

Permalink
Remove outdated tests in test_isinstance (GH-1393)
Browse files Browse the repository at this point in the history
There is no need to test for new-style classes versus classic classes in Python 3.
  • Loading branch information
DimitrisJim authored and brettcannon committed May 2, 2017
1 parent f06e021 commit 094909a
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions Lib/test/test_isinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,6 @@ class Super:

class Child(Super):
pass

# new-style classes
class NewSuper(object):
pass

class NewChild(NewSuper):
pass



class TestIsInstanceIsSubclass(unittest.TestCase):
# Tests to ensure that isinstance and issubclass work on abstract
Expand Down Expand Up @@ -247,15 +238,8 @@ def test_subclass_tuple(self):
self.assertEqual(False, issubclass(Child, ()))
self.assertEqual(True, issubclass(Super, (Child, (Super,))))

self.assertEqual(True, issubclass(NewChild, (NewChild,)))
self.assertEqual(True, issubclass(NewChild, (NewSuper,)))
self.assertEqual(False, issubclass(NewSuper, (NewChild,)))
self.assertEqual(True, issubclass(NewSuper, (NewChild, NewSuper)))
self.assertEqual(False, issubclass(NewChild, ()))
self.assertEqual(True, issubclass(NewSuper, (NewChild, (NewSuper,))))

self.assertEqual(True, issubclass(int, (int, (float, int))))
self.assertEqual(True, issubclass(str, (str, (Child, NewChild, str))))
self.assertEqual(True, issubclass(str, (str, (Child, str))))

def test_subclass_recursion_limit(self):
# make sure that issubclass raises RecursionError before the C stack is
Expand Down

0 comments on commit 094909a

Please sign in to comment.