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 | bd08ffa8a50d8175b607d268c9857ef92e0d231d (patch) | |
tree | 88faeaff7f5d6f17f0832a10dcdea16add287bfb /tests/test_html.py | |
parent | b976d22f5c6f9d42cbaf3bff5e3dd3faa0987838 (diff) | |
download | python-coveragepy-git-bd08ffa8a50d8175b607d268c9857ef92e0d231d.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/test_html.py')
-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 fd16fdd2..75169bad 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): |