summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2020-09-12 19:42:14 -0400
committerNed Batchelder <ned@nedbatchelder.com>2020-09-12 19:42:39 -0400
commit263f3e1da8e5a6a32056a8697286f9adf0f6a55d (patch)
treea5dc4806aa85159ed15a4c80e228d8b58de38fef /tests
parentecd6ab19a43a444bc7fc9dfbc08f3ca5274365ca (diff)
downloadpython-coveragepy-git-263f3e1da8e5a6a32056a8697286f9adf0f6a55d.tar.gz
Docs and cleanup for source_pkgs
Diffstat (limited to 'tests')
-rw-r--r--tests/modules/ambigious/pkg1/__init__.py1
-rw-r--r--tests/modules/ambigious/pkg1/ambigious.py2
-rw-r--r--tests/modules/usepkgs.py1
-rw-r--r--tests/test_api.py9
4 files changed, 6 insertions, 7 deletions
diff --git a/tests/modules/ambigious/pkg1/__init__.py b/tests/modules/ambigious/pkg1/__init__.py
index e69de29b..59742bbb 100644
--- a/tests/modules/ambigious/pkg1/__init__.py
+++ b/tests/modules/ambigious/pkg1/__init__.py
@@ -0,0 +1 @@
+print("Ambiguous pkg1")
diff --git a/tests/modules/ambigious/pkg1/ambigious.py b/tests/modules/ambigious/pkg1/ambigious.py
index e69de29b..6048d6da 100644
--- a/tests/modules/ambigious/pkg1/ambigious.py
+++ b/tests/modules/ambigious/pkg1/ambigious.py
@@ -0,0 +1,2 @@
+amb = 1
+amb = 2
diff --git a/tests/modules/usepkgs.py b/tests/modules/usepkgs.py
index 63ce7c18..2e4d21a7 100644
--- a/tests/modules/usepkgs.py
+++ b/tests/modules/usepkgs.py
@@ -5,3 +5,4 @@ import pkg1.p1a, pkg1.p1b, pkg1.sub
import pkg2.p2a, pkg2.p2b
import othermods.othera, othermods.otherb
import othermods.sub.osa, othermods.sub.osb
+import ambigious, ambigious.pkg1.ambigious
diff --git a/tests/test_api.py b/tests/test_api.py
index 7311073a..a28d0133 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -940,13 +940,8 @@ class SourceIncludeOmitTest(IncludeOmitTestsMixin, CoverageTest):
self.chdir(self.nice_file(TESTS_DIR, 'modules', "ambigious"))
# pkg1 defaults to directory because tests/modules/ambigious/pkg1 exists
lines = self.coverage_usepkgs(source=["pkg1"])
- self.assertEqual(
- self.coverage_usepkgs(source=["pkg1"]),
- {
- u"__init__.py": 0, u"__init__": 0,
- u"ambigious.py": 0, u"ambigious": 0,
- },
- )
+ self.filenames_in(lines, "ambigious")
+ self.filenames_not_in(lines, "p1a p1b p1c")
def test_ambigious_source_package_as_package(self):
# pkg1 is a directory and a pkg, since we cd into tests/modules/ambigious