From f1e7e8681c209acc5ff0d2c7a4bd452fd4ac6e17 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Fri, 25 Sep 2020 09:13:02 -0700 Subject: [PATCH 1/2] [testing] print test case when an Invalid test fails for easier debug --- fixit/common/testing.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fixit/common/testing.py b/fixit/common/testing.py index 50fb5e45..7e49df2d 100644 --- a/fixit/common/testing.py +++ b/fixit/common/testing.py @@ -87,7 +87,8 @@ def _test_method( self.assertGreater( len(reports), 0, - 'Expected a report for this "invalid" test case. `self.report` was not called.', + 'Expected a report for this "invalid" test case but `self.report` was ' + + 'not called:\n' + test_case.code, ) self.assertLessEqual( len(reports), From b08cdfd4c9ff1b8fced48ca0835fea6b858b99a8 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Fri, 25 Sep 2020 09:18:22 -0700 Subject: [PATCH 2/2] reformat --- fixit/common/testing.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fixit/common/testing.py b/fixit/common/testing.py index 7e49df2d..07234d04 100644 --- a/fixit/common/testing.py +++ b/fixit/common/testing.py @@ -88,7 +88,8 @@ def _test_method( len(reports), 0, 'Expected a report for this "invalid" test case but `self.report` was ' - + 'not called:\n' + test_case.code, + + "not called:\n" + + test_case.code, ) self.assertLessEqual( len(reports),