From 33e3bb1e4e326713f85749705179da2e31520670 Mon Sep 17 00:00:00 2001 From: Batuhan Taskaya Date: Sun, 16 Jan 2022 01:19:37 +0300 Subject: [PATCH] [trivial] Use proper test cases on `unittest` (#2775) --- tests/test_black.py | 4 ++-- tests/test_primer.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_black.py b/tests/test_black.py index 91d1058..202fe23 100644 --- a/tests/test_black.py +++ b/tests/test_black.py @@ -940,8 +940,8 @@ class BlackTestCase(BlackBaseTestCase): self.assertFormatEqual("j = [1, 2, 3]", "j = [1, 2, 3,]") out_str = "".join(out_lines) - self.assertTrue("Expected tree:" in out_str) - self.assertTrue("Actual tree:" in out_str) + self.assertIn("Expected tree:", out_str) + self.assertIn("Actual tree:", out_str) self.assertEqual("".join(err_lines), "") @event_loop() diff --git a/tests/test_primer.py b/tests/test_primer.py index 9bb4015..0a9d2ae 100644 --- a/tests/test_primer.py +++ b/tests/test_primer.py @@ -181,7 +181,7 @@ class PrimerLibTests(unittest.TestCase): stdout, stderr = loop.run_until_complete( lib._gen_check_output([lib.BLACK_BINARY, "--help"]) ) - self.assertTrue("The uncompromising code formatter" in stdout.decode("utf8")) + self.assertIn("The uncompromising code formatter", stdout.decode("utf8")) self.assertEqual(None, stderr) # TODO: Add a test to see failure works on Windows -- 2.39.5