From: Vladimír Vondruš Date: Thu, 26 Sep 2024 10:57:04 +0000 (+0200) Subject: documentation: don't exclude trailing file whitespace in tests. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=fd1f23dd1c93b606ab95217bc6db68c5ca6a8657;p=blog.git 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. --- 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