Speed up wiring tests

This commit is contained in:
Roman Mogylatov 2021-03-08 18:01:36 -05:00
parent aa9fbb3b3d
commit a80e027c51
3 changed files with 14 additions and 14 deletions

View File

@ -0,0 +1,13 @@
"""Test module for wiring."""
import sys
if 'pypy' not in sys.version.lower():
import numpy # noqa
from numpy import * # noqa
import scipy # noqa
from scipy import * # noqa
import builtins # noqa
from builtins import * # noqa

View File

@ -1,7 +1,6 @@
"""Test module for wiring."""
from decimal import Decimal
import sys
from typing import Callable
from dependency_injector import providers
@ -129,16 +128,3 @@ def test_class_decorator(service: Service = Provide[Container.service]):
def test_container(container: Container = Provide[Container]):
return container.service()
# Import tests
if 'pypy' not in sys.version.lower():
import numpy # noqa
from numpy import * # noqa
import scipy # noqa
from scipy import * # noqa
import builtins # noqa
from builtins import * # noqa

View File

@ -437,6 +437,7 @@ class AutoLoaderTest(unittest.TestCase):
def test_register_container(self):
register_loader_containers(self.container)
importlib.reload(module)
importlib.import_module('wiringsamples.imports')
service = module.test_function()
self.assertIsInstance(service, Service)