2023-10-04 06:53:15 -04:00
|
|
|
import setuptools
|
|
|
|
|
2025-01-17 21:38:29 +05:30
|
|
|
from datahub.testing.check_imports import ensure_no_indirect_model_imports
|
2024-03-27 14:32:53 -07:00
|
|
|
from tests.utils import PytestConfig
|
|
|
|
|
2023-10-04 06:53:15 -04:00
|
|
|
|
|
|
|
def test_package_list_match_inits():
|
|
|
|
where = "./src"
|
|
|
|
package_list = set(setuptools.find_packages(where))
|
|
|
|
namespace_packages = set(setuptools.find_namespace_packages(where))
|
|
|
|
assert package_list == namespace_packages, "are you missing a package init file?"
|
2024-03-18 14:59:18 -07:00
|
|
|
|
|
|
|
|
2024-03-27 14:32:53 -07:00
|
|
|
def test_check_import_paths(pytestconfig: PytestConfig) -> None:
|
2024-03-18 14:59:18 -07:00
|
|
|
root = pytestconfig.rootpath
|
|
|
|
|
|
|
|
ensure_no_indirect_model_imports([root / "src", root / "tests"])
|