Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove backported unittest methods #705

Merged
merged 1 commit into from May 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 0 additions & 35 deletions pyflakes/test/harness.py
Expand Up @@ -35,38 +35,3 @@ def flakes(self, input, *expectedOutputs, **kw):
but got:
%s''' % (input, expectedOutputs, '\n'.join([str(o) for o in w.messages])))
return w

if not hasattr(unittest.TestCase, 'assertIs'):

def assertIs(self, expr1, expr2, msg=None):
if expr1 is not expr2:
self.fail(msg or '%r is not %r' % (expr1, expr2))

if not hasattr(unittest.TestCase, 'assertIsInstance'):

def assertIsInstance(self, obj, cls, msg=None):
"""Same as self.assertTrue(isinstance(obj, cls))."""
if not isinstance(obj, cls):
self.fail(msg or '%r is not an instance of %r' % (obj, cls))

if not hasattr(unittest.TestCase, 'assertNotIsInstance'):

def assertNotIsInstance(self, obj, cls, msg=None):
"""Same as self.assertFalse(isinstance(obj, cls))."""
if isinstance(obj, cls):
self.fail(msg or '%r is an instance of %r' % (obj, cls))

if not hasattr(unittest.TestCase, 'assertIn'):

def assertIn(self, member, container, msg=None):
"""Just like self.assertTrue(a in b)."""
if member not in container:
self.fail(msg or '%r not found in %r' % (member, container))

if not hasattr(unittest.TestCase, 'assertNotIn'):

def assertNotIn(self, member, container, msg=None):
"""Just like self.assertTrue(a not in b)."""
if member in container:
self.fail(msg or
'%r unexpectedly found in %r' % (member, container))