summaryrefslogtreecommitdiff
path: root/tests/test_files.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_files.py')
-rw-r--r--tests/test_files.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/test_files.py b/tests/test_files.py
index 561b961d..a69d1a4b 100644
--- a/tests/test_files.py
+++ b/tests/test_files.py
@@ -585,13 +585,30 @@ class FindPythonFilesTest(CoverageTest):
self.make_file("sub/ssub/~s.py") # nope: editor effluvia
self.make_file("sub/lab/exp.py") # nope: no __init__.py
self.make_file("sub/windows.pyw")
- py_files = set(find_python_files("sub"))
+ py_files = set(find_python_files("sub", include_namespace_packages=False))
self.assert_same_files(py_files, [
"sub/a.py", "sub/b.py",
"sub/ssub/__init__.py", "sub/ssub/s.py",
"sub/windows.pyw",
])
+ def test_find_python_files_include_namespace_packages(self):
+ self.make_file("sub/a.py")
+ self.make_file("sub/b.py")
+ self.make_file("sub/x.c") # nope: not .py
+ self.make_file("sub/ssub/__init__.py")
+ self.make_file("sub/ssub/s.py")
+ self.make_file("sub/ssub/~s.py") # nope: editor effluvia
+ self.make_file("sub/lab/exp.py")
+ self.make_file("sub/windows.pyw")
+ py_files = set(find_python_files("sub", include_namespace_packages=True))
+ self.assert_same_files(py_files, [
+ "sub/a.py", "sub/b.py",
+ "sub/ssub/__init__.py", "sub/ssub/s.py",
+ "sub/lab/exp.py",
+ "sub/windows.pyw",
+ ])
+
@pytest.mark.skipif(not env.WINDOWS, reason="Only need to run Windows tests on Windows.")
class WindowsFileTest(CoverageTest):