Move generic types test to separate module

This commit is contained in:
Roman Mogylatov 2020-09-13 20:38:23 -04:00
parent d8439a28b1
commit 39368591b9
2 changed files with 15 additions and 5 deletions

View File

@ -139,11 +139,6 @@ class ProviderTests(unittest.TestCase):
self.assertIsNot(overriding_provider, overriding_provider_copy) self.assertIsNot(overriding_provider, overriding_provider_copy)
self.assertIsInstance(overriding_provider_copy, providers.Provider) self.assertIsInstance(overriding_provider_copy, providers.Provider)
def test_generic_type(self):
provider: providers.Provider[object] = providers.Factory(object)
some_object = provider()
self.assertIsInstance(some_object, object)
def test_repr(self): def test_repr(self):
self.assertEqual(repr(self.provider), self.assertEqual(repr(self.provider),
'<dependency_injector.providers.' '<dependency_injector.providers.'

View File

@ -0,0 +1,15 @@
import unittest
from dependency_injector import providers
class SomeClass:
...
class TypesTest(unittest.TestCase):
def test_provider(self):
provider: providers.Provider[SomeClass] = providers.Factory(SomeClass)
some_object = provider()
self.assertIsInstance(some_object, SomeClass)