From fd1f23dd1c93b606ab95217bc6db68c5ca6a8657 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 26 Sep 2024 12:57:04 +0200 Subject: [PATCH] documentation: don't exclude trailing file whitespace in tests. This makes it impossible to ensure that a template doesn't leave extra newlines at the end. --- documentation/test_doxygen/__init__.py | 4 ++-- .../test_doxygen/contents_htmlonly_htmlinclude/warnings.html | 2 +- documentation/test_python/__init__.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/documentation/test_doxygen/__init__.py b/documentation/test_doxygen/__init__.py index 36865fd0..bdeb7089 100644 --- a/documentation/test_doxygen/__init__.py +++ b/documentation/test_doxygen/__init__.py @@ -91,9 +91,9 @@ class BaseTestCase(unittest.TestCase): def actual_expected_contents(self, actual, expected = None): if not expected: expected = actual with open(os.path.join(self.path, expected)) as f: - expected_contents = f.read().strip() + expected_contents = f.read() with open(os.path.join(self.path, 'html', actual)) as f: - actual_contents = f.read().strip() + actual_contents = f.read() actual_contents = _normalize_hashes.sub('g'*33, actual_contents) expected_contents = _normalize_hashes.sub('g'*33, expected_contents) return actual_contents, expected_contents diff --git a/documentation/test_doxygen/contents_htmlonly_htmlinclude/warnings.html b/documentation/test_doxygen/contents_htmlonly_htmlinclude/warnings.html index cc2980a1..2db371b5 100644 --- a/documentation/test_doxygen/contents_htmlonly_htmlinclude/warnings.html +++ b/documentation/test_doxygen/contents_htmlonly_htmlinclude/warnings.html @@ -27,4 +27,4 @@ - \ No newline at end of file + diff --git a/documentation/test_python/__init__.py b/documentation/test_python/__init__.py index c8a3a6ca..16b62a1f 100644 --- a/documentation/test_python/__init__.py +++ b/documentation/test_python/__init__.py @@ -98,9 +98,9 @@ class BaseTestCase(unittest.TestCase): if not expected: expected = actual with open(os.path.join(self.path, expected)) as f: - expected_contents = f.read().strip() + expected_contents = f.read() with open(os.path.join(self.path, 'output', actual)) as f: - actual_contents = f.read().strip() + actual_contents = f.read() return actual_contents, expected_contents # On top of the automagic of BaseTestCase this automatically sets INPUT_MODULES -- 2.30.2