コード例 #1
0
 def test_my_singleton(self):
     for x in self.my_singleton_instances:
         self.assertIs(x, MySingleton.getInstance())
コード例 #2
0
 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)]