twgOren / roroioc

IOC Injection for python
MIT License
0 stars 1 forks source link

Better exception when injector was never armed #2

Open orenovadia opened 6 years ago

orenovadia commented 6 years ago

Before first ever injection, an empty invocation crashes with obscure error instead of normal NoValuesProvided

Recreated by:

def test_error_never_injected(self):
        AppliedInjection().test()

This creates the following error: AttributeError: 'thread._local' object has no attribute 'resources'

See first couple of lines at roro_ioc.instance_ioc_container._integrate_resources

There is a skipped test here: tests.test_structured_injection.TestErrorHandling#test_no_values_provided_first_injection