diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-04-21 21:31:58 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-04-21 21:31:58 -0400 |
commit | 2a7a4f2161d26eeb898f3deec3f7ce21b0f2f957 (patch) | |
tree | 6ae60d1198cc845a239a9635acc5ecd6a5af744d /tests | |
parent | 71e2e22f6d7601218f08ed038689fe8abc871d17 (diff) | |
download | python-coveragepy-2a7a4f2161d26eeb898f3deec3f7ce21b0f2f957.tar.gz |
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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_html.py | 11 |
1 files changed, 8 insertions, 3 deletions
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("<p>Created on {time_stamp}</p>".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): |