Replace custom assertContains() with unitest2 assertIn()

pull/65/head
Alex Willmer 7 years ago
parent 9351a44784
commit fdccf6a891

@ -36,7 +36,7 @@ class CommandLineTest(testlib.RouterMixin, testlib.TestCase):
stdout, stderr = proc.communicate() stdout, stderr = proc.communicate()
self.assertEquals(0, proc.returncode) self.assertEquals(0, proc.returncode)
self.assertEquals("EC0\n", stdout) self.assertEquals("EC0\n", stdout)
self.assertContains("EOFError", stderr) self.assertIn("EOFError", stderr)
if __name__ == '__main__': if __name__ == '__main__':

@ -126,9 +126,6 @@ class TestCase(unittest.TestCase):
assert 0, '%r raised %r, not %r' % (func, e, exc) assert 0, '%r raised %r, not %r' % (func, e, exc)
assert 0, '%r did not raise %r' % (func, exc) assert 0, '%r did not raise %r' % (func, exc)
def assertContains(self, needle, hay):
assert needle in hay, "%r not found in %r" % (needle, hay)
class DockerizedSshDaemon(object): class DockerizedSshDaemon(object):
def __init__(self): def __init__(self):

Loading…
Cancel
Save