litellm/tests/unit/test_package_layout.py
yuneng e4a58ef91a test(unit): make every tests/unit directory a package so pytest collection is unique
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 11:50:59 +00:00

12 lines
418 B
Python

import os
TESTS_UNIT_DIR = os.path.dirname(os.path.abspath(__file__))
def test_every_directory_under_tests_unit_is_a_package():
missing = []
for root, dirs, _files in os.walk(TESTS_UNIT_DIR):
dirs[:] = [d for d in dirs if d != "__pycache__"]
if not os.path.isfile(os.path.join(root, "__init__.py")):
missing.append(os.path.relpath(root, TESTS_UNIT_DIR))
assert missing == []