tests: Fix test_imports_panda3d for frozen/embedded panda3d package

This commit is contained in:
rdb 2023-02-24 20:24:37 +01:00
parent 4f9542c96a
commit 868a4eac47

View File

@ -9,8 +9,15 @@ import pytest
def test_imports_panda3d():
import importlib, os
import importlib, os, sys
import panda3d
# Look for panda3d.* modules in builtins - pfreeze might put them there.
for mod in sys.builtin_module_names:
if mod.startswith('panda3d.'):
importlib.import_module(mod)
if panda3d.__spec__.origin != 'frozen':
dir = os.path.dirname(panda3d.__file__)
# Iterate over the things in the panda3d package that look like modules.