diff options
author | Thomas Grainger <tagrain@gmail.com> | 2020-09-12 21:49:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-12 16:49:54 -0400 |
commit | 154f5284e124e610d80a0b5c7e3fac9132c891d6 (patch) | |
tree | d63361f463d36a8633f5346f31681e31ea351cab /tests/test_api.py | |
parent | c3159081ae67864f75aacc1b86310fe9d8d614cb (diff) | |
download | python-coveragepy-git-154f5284e124e610d80a0b5c7e3fac9132c891d6.tar.gz |
replace confusing comment with assertion (#1028)
Diffstat (limited to 'tests/test_api.py')
-rw-r--r-- | tests/test_api.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/test_api.py b/tests/test_api.py index 5ede9158..ab4b8a8f 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -887,21 +887,30 @@ class SourceIncludeOmitTest(IncludeOmitTestsMixin, CoverageTest): cov.start() cov.stop() # pragma: nested + def test_source_package_as_package(self): + self.assertFalse(os.path.isdir("pkg1")) + lines = self.coverage_usepkgs(source=["pkg1"]) + self.filenames_in(lines, "p1a p1b") + self.filenames_not_in(lines, "p2a p2b othera otherb osa osb") + # Because source= was specified, we do search for unexecuted files. + self.assertEqual(lines['p1c'], 0) + def test_source_package_as_dir(self): - # pkg1 is a directory, since we cd'd into tests/modules in setUp. + self.chdir(self.nice_file(TESTS_DIR, 'modules')) + self.assertTrue(os.path.isdir("pkg1")) lines = self.coverage_usepkgs(source=["pkg1"]) self.filenames_in(lines, "p1a p1b") self.filenames_not_in(lines, "p2a p2b othera otherb osa osb") # Because source= was specified, we do search for unexecuted files. self.assertEqual(lines['p1c'], 0) - def test_source_package_as_package(self): + def test_source_package_dotted_sub(self): lines = self.coverage_usepkgs(source=["pkg1.sub"]) self.filenames_not_in(lines, "p2a p2b othera otherb osa osb") # Because source= was specified, we do search for unexecuted files. self.assertEqual(lines['runmod3'], 0) - def test_source_package_dotted(self): + def test_source_package_dotted_p1b(self): lines = self.coverage_usepkgs(source=["pkg1.p1b"]) self.filenames_in(lines, "p1b") self.filenames_not_in(lines, "p1a p1c p2a p2b othera otherb osa osb") |