summaryrefslogtreecommitdiff
path: root/tests/test_coverage.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_coverage.py')
-rw-r--r--tests/test_coverage.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/test_coverage.py b/tests/test_coverage.py
index 35c7c25c..e2f0a614 100644
--- a/tests/test_coverage.py
+++ b/tests/test_coverage.py
@@ -1,5 +1,7 @@
-"""Tests for Coverage."""
-# http://nedbatchelder.com/code/coverage
+# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
+# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
+
+"""Tests for coverage.py."""
import coverage
from coverage import env
@@ -1424,7 +1426,7 @@ class ExcludeTest(CoverageTest):
[1,2,3,4,5,6,9], "", excludes=['#pragma: NO COVER'])
def test_excluding_if_pass(self):
- # From a comment on the coverage page by Michael McNeil Forbes:
+ # From a comment on the coverage.py page by Michael McNeil Forbes:
self.check_coverage("""\
def f():
if False: # pragma: no cover
@@ -1663,8 +1665,11 @@ class ModuleTest(CoverageTest):
def test_not_singleton(self):
# You *can* create another coverage object.
- coverage.coverage()
- coverage.coverage()
+ coverage.Coverage()
+ coverage.Coverage()
+
+ def test_old_name_and_new_name(self):
+ self.assertIs(coverage.coverage, coverage.Coverage)
class ReportingTest(CoverageTest):
@@ -1672,7 +1677,7 @@ class ReportingTest(CoverageTest):
# We don't make any temp files, but we need an empty directory to run the
# tests in.
- run_in_temp_dir = True
+ no_files_in_temp_dir = True
def test_no_data_to_report_on_annotate(self):
# Reporting with no data produces a nice message and no output dir.
@@ -1680,10 +1685,6 @@ class ReportingTest(CoverageTest):
self.command_line("annotate -d ann")
self.assert_doesnt_exist("ann")
- # CoverageTest will yell at us for using a temp directory with no files
- # made. Instead of adding a way to shut it up, just make a file.
- self.make_file("touch.txt", "")
-
def test_no_data_to_report_on_html(self):
# Reporting with no data produces a nice message and no output dir.
with self.assertRaisesRegex(CoverageException, "No data to report."):