Skip to content

Commit 154f528

Browse files
authored
replace confusing comment with assertion (#1028)
1 parent c315908 commit 154f528

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

tests/test_api.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -887,21 +887,30 @@ def test_source_include_exclusive(self):
887887
cov.start()
888888
cov.stop() # pragma: nested
889889

890+
def test_source_package_as_package(self):
891+
self.assertFalse(os.path.isdir("pkg1"))
892+
lines = self.coverage_usepkgs(source=["pkg1"])
893+
self.filenames_in(lines, "p1a p1b")
894+
self.filenames_not_in(lines, "p2a p2b othera otherb osa osb")
895+
# Because source= was specified, we do search for unexecuted files.
896+
self.assertEqual(lines['p1c'], 0)
897+
890898
def test_source_package_as_dir(self):
891-
# pkg1 is a directory, since we cd'd into tests/modules in setUp.
899+
self.chdir(self.nice_file(TESTS_DIR, 'modules'))
900+
self.assertTrue(os.path.isdir("pkg1"))
892901
lines = self.coverage_usepkgs(source=["pkg1"])
893902
self.filenames_in(lines, "p1a p1b")
894903
self.filenames_not_in(lines, "p2a p2b othera otherb osa osb")
895904
# Because source= was specified, we do search for unexecuted files.
896905
self.assertEqual(lines['p1c'], 0)
897906

898-
def test_source_package_as_package(self):
907+
def test_source_package_dotted_sub(self):
899908
lines = self.coverage_usepkgs(source=["pkg1.sub"])
900909
self.filenames_not_in(lines, "p2a p2b othera otherb osa osb")
901910
# Because source= was specified, we do search for unexecuted files.
902911
self.assertEqual(lines['runmod3'], 0)
903912

904-
def test_source_package_dotted(self):
913+
def test_source_package_dotted_p1b(self):
905914
lines = self.coverage_usepkgs(source=["pkg1.p1b"])
906915
self.filenames_in(lines, "p1b")
907916
self.filenames_not_in(lines, "p1a p1c p2a p2b othera otherb osa osb")

0 commit comments

Comments
 (0)