Adds missing module_specs for usages of _LazyModule (#15230)

* Add missing __spec__ for transformers.models.auto

* Moves the __spec__-test to the UnitTest class

* Adds module_spec to all instances of _LazyModule

* Refactors an old test from pytest to unittest
This commit is contained in:
Jonas Kuball
2022-01-21 13:30:12 +01:00
committed by GitHub
parent 6c7b68d414
commit c962c2adbf
101 changed files with 110 additions and 101 deletions

View File

@@ -210,4 +210,4 @@ if TYPE_CHECKING:
else:
import sys
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)