def test_my_singleton(self): for x in self.my_singleton_instances: self.assertIs(x, MySingleton.getInstance())
def setUp(self): self.singleton_instances = [Singleton() for x in range(100)] self.my_class_instances = [MyClass() for x in range(100)] self.my_singleton_instances = [MySingleton.getInstance() for x in range(100)]