[trivial] Use proper test cases on unittest (#2775)

This commit is contained in:
Batuhan Taskaya 2022-01-16 01:19:37 +03:00 committed by GitHub
parent 5fe6d48fcd
commit 33e3bb1e4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -940,8 +940,8 @@ def err(msg: str, **kwargs: Any) -> None:
self.assertFormatEqual("j = [1, 2, 3]", "j = [1, 2, 3,]") self.assertFormatEqual("j = [1, 2, 3]", "j = [1, 2, 3,]")
out_str = "".join(out_lines) out_str = "".join(out_lines)
self.assertTrue("Expected tree:" in out_str) self.assertIn("Expected tree:", out_str)
self.assertTrue("Actual tree:" in out_str) self.assertIn("Actual tree:", out_str)
self.assertEqual("".join(err_lines), "") self.assertEqual("".join(err_lines), "")
@event_loop() @event_loop()

View File

@ -181,7 +181,7 @@ def test_gen_check_output(self) -> None:
stdout, stderr = loop.run_until_complete( stdout, stderr = loop.run_until_complete(
lib._gen_check_output([lib.BLACK_BINARY, "--help"]) 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) self.assertEqual(None, stderr)
# TODO: Add a test to see failure works on Windows # TODO: Add a test to see failure works on Windows