From df9556d1d9e7e73e4223373a46c63b7be296ae1e Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Sat, 11 Nov 2017 23:02:26 +0000 Subject: [PATCH] Replace custom assertContains() with unitest2 assertIn() --- tests/first_stage_test.py | 2 +- tests/testlib.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/first_stage_test.py b/tests/first_stage_test.py index 509954e0..c94af2b5 100644 --- a/tests/first_stage_test.py +++ b/tests/first_stage_test.py @@ -36,7 +36,7 @@ class CommandLineTest(testlib.RouterMixin, testlib.TestCase): stdout, stderr = proc.communicate() self.assertEquals(0, proc.returncode) self.assertEquals("EC0\n", stdout) - self.assertContains("EOFError", stderr) + self.assertIn("EOFError", stderr) if __name__ == '__main__': diff --git a/tests/testlib.py b/tests/testlib.py index c56bb9d1..29c8ab62 100644 --- a/tests/testlib.py +++ b/tests/testlib.py @@ -126,9 +126,6 @@ class TestCase(unittest.TestCase): assert 0, '%r raised %r, not %r' % (func, e, 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): def __init__(self):