From 2a7a4f2161d26eeb898f3deec3f7ce21b0f2f957 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 21 Apr 2015 21:31:58 -0400 Subject: More work on #299 Add the timestamp to the Python output files also. Move the timestamp to the footer. Add Conrad to AUTHORS, and update the CHANGES file. --- tests/test_html.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/test_html.py b/tests/test_html.py index fd16fdd..75169ba 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -367,10 +367,15 @@ class HtmlTest(HtmlTestHelpers, CoverageTest): def test_has_date_stamp_in_index(self): self.create_initial_files() self.run_coverage() + # Note: in theory this test could fail if the HTML files are created + # at 1:23:59.999 and this timestamp is grabbed at 1:24:00.000. + footer = "created at {time_stamp}".format( + time_stamp=datetime.datetime.now().strftime('%Y-%m-%d %H:%M') + ) with open("htmlcov/index.html") as f: - index = f.read() - time_stamp = datetime.datetime.now().strftime('%Y-%m-%d %H:%M') - self.assertIn("

Created on {time_stamp}

".format(time_stamp=time_stamp), index) + self.assertIn(footer, f.read()) + with open("htmlcov/main_file_py.html") as f: + self.assertIn(footer, f.read()) class HtmlStaticFileTest(CoverageTest): -- cgit v1.2.1