tests: fix test_imports not to import things starting with 'lib'

This commit is contained in:
rdb 2019-09-06 13:43:25 +02:00
parent 2e198fd2ef
commit 53ff35dd6e

View File

@ -13,11 +13,16 @@ def test_imports_panda3d():
import panda3d import panda3d
dir = os.path.dirname(panda3d.__file__) dir = os.path.dirname(panda3d.__file__)
# Iterate over the things in the panda3d package that look like modules.
extensions = set() extensions = set()
for suffix in imp.get_suffixes(): for suffix in imp.get_suffixes():
extensions.add(suffix[0]) extensions.add(suffix[0])
for basename in os.listdir(dir): for basename in os.listdir(dir):
if basename.startswith('lib'):
# This not a Python module.
return
module = basename.split('.', 1)[0] module = basename.split('.', 1)[0]
ext = basename[len(module):] ext = basename[len(module):]