def test_same_instance(self): """ Test that the providers dict is still the same instance. """ providers = syringe._PROVIDERS syringe.clear() self.assertIs(providers, syringe._PROVIDERS)
def test_empty(self): """ Test that the providers dict is empty after clearing. """ @syringe.provides('mock') class CLS(object): pass CLS() self.assertIn('mock', syringe._PROVIDERS) syringe.clear() self.assertDictEqual({}, syringe._PROVIDERS)