def print_list(self): try: self.lock.acquire() CircularLinkedList.print_list(self) finally: self.lock.release()
def test_iter(self): llist = CircularLinkedList() llist.append('A') llist.append('B') llist.print_list() self.assertEqual(llist.to_list(), ['A', 'B'])