From 823a5834ab9e2a63abcfe1fd1a21111d09b5be9d Mon Sep 17 00:00:00 2001 From: Stephen Roller Date: Wed, 28 Apr 2021 11:24:17 -0400 Subject: [PATCH] [tests] Make crowdsource tests whitespace-agnostic (#3628) --- parlai/crowdsourcing/tasks/acute_eval/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parlai/crowdsourcing/tasks/acute_eval/util.py b/parlai/crowdsourcing/tasks/acute_eval/util.py index 1a39b544a62..eec5206c569 100644 --- a/parlai/crowdsourcing/tasks/acute_eval/util.py +++ b/parlai/crowdsourcing/tasks/acute_eval/util.py @@ -191,7 +191,9 @@ def _check_file_contents( results_folder=results_folder, file_suffix=file_suffix ) with open(file_path) as f: - contents = f.read() + # correct whitespace to deal with fbcode demanding disk files not + # have many trailing newlines + contents = f.read().rstrip('\n') + '\n' file_regression.check(contents=contents) def _get_matching_file_path(self, results_folder: str, file_suffix: str) -> str: