diff --git a/benchmark/tests/scripts/Be_Report_test.py b/benchmark/tests/scripts/Be_Report_test.py index cc03a8d..b2848ce 100644 --- a/benchmark/tests/scripts/Be_Report_test.py +++ b/benchmark/tests/scripts/Be_Report_test.py @@ -111,7 +111,16 @@ class BeReportTest(TestBase): def test_be_report_without_subcommand(self): stdout, stderr = self.execute_script("be_report", "") self.assertEqual(stderr.getvalue(), "") - self.check_output_file(stdout, "report_without_subcommand") + self.maxDiff = None + # Can't use check_output_file because of the width of the console + # output is different in different environments + file_name = "report_without_subcommand" + self.ext + with open(os.path.join(self.test_files, file_name)) as f: + expected = f.read() + if expected == stdout.getvalue(): + self.assertEqual(stdout.getvalue(), expected) + else: + self.check_output_file(stdout, "report_without_subcommand2") def test_be_report_excel_compared(self): file_name = "results_accuracy_STree_iMac27_2021-09-30_11:42:07_0.json" diff --git a/benchmark/tests/test_files/report_without_subcommand2.test b/benchmark/tests/test_files/report_without_subcommand2.test new file mode 100644 index 0000000..8dc4776 --- /dev/null +++ b/benchmark/tests/test_files/report_without_subcommand2.test @@ -0,0 +1,14 @@ +usage: be_report [-h] {best,grid,file,datasets} ... + +positional arguments: + {best,grid,file,datasets} + help for subcommand + best Report best results obtained by any model/score. See + be_build_best + grid Report grid results obtained by any model/score. See + be_build_grid + file Report file results + datasets Report datasets information + +options: + -h, --help show this help message and exit