diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_config.py | 3 | ||||
| -rw-r--r-- | tests/test_files.py | 19 |
2 files changed, 21 insertions, 1 deletions
diff --git a/tests/test_config.py b/tests/test_config.py index 444719fd..5f8a0547 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -494,6 +494,8 @@ class ConfigFileTest(UsingModulesMixin, CoverageTest): skip_covered = TruE skip_empty =TruE + include_namespace_packages = TRUE + [{section}html] directory = c:\\tricky\\dir.somewhere @@ -589,6 +591,7 @@ class ConfigFileTest(UsingModulesMixin, CoverageTest): assert cov.config.get_plugin_options("plugins.another") == {} assert cov.config.json_show_contexts is True assert cov.config.json_pretty_print is True + assert cov.config.include_namespace_packages is True def test_config_file_settings(self): self.make_file(".coveragerc", self.LOTSA_SETTINGS.format(section="")) 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): |
