Commit b118b5f2 authored by Jason R. Coombs's avatar Jason R. Coombs

Add test capturing overmatching in new find_packages. Ref #184.

parent 95135250
...@@ -88,6 +88,17 @@ class TestFindPackages(unittest.TestCase): ...@@ -88,6 +88,17 @@ class TestFindPackages(unittest.TestCase):
packages = find_packages(self.dist_dir) packages = find_packages(self.dist_dir)
self.assertTrue('pkg.some.data' not in packages) self.assertTrue('pkg.some.data' not in packages)
def test_dir_with_packages_in_subdir_is_excluded(self):
"""
Ensure that a package in a non-package such as build/pkg/__init__.py
is excluded.
"""
build_dir = self._mkdir('build', self.dist_dir)
build_pkg_dir = self._mkdir('pkg', build_dir)
self._touch('__init__.py', build_pkg_dir)
packages = find_packages(self.dist_dir)
self.assertTrue('build.pkg' not in packages)
def _assert_packages(self, actual, expected): def _assert_packages(self, actual, expected):
self.assertEqual(set(actual), set(expected)) self.assertEqual(set(actual), set(expected))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment