Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace confusing comment with assertion #1028

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 12 additions & 3 deletions tests/test_api.py
Expand Up @@ -887,21 +887,30 @@ def test_source_include_exclusive(self):
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):
Comment on lines +907 to +913
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nedbat I'm not really clear what the difference between these two tests is

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pkg1.sub is a directory, pkg1.p1b is a file.

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")
Expand Down