def test_alloc(self):
        """
        Send a new style object and check the number of allocations.
        """
        orig = NewStyleCopy2()
        self.assertEqual(NewStyleCopy2.allocated, 1)
        self.assertEqual(NewStyleCopy2.initialized, 1)
        d = self.ref.callRemote("echo", orig)
        self.pump.flush()
        def cb(res):
            # Receiving the response creates a third one on the way back
            self.assertIsInstance(res, NewStyleCopy2)
            self.assertEqual(res.value, 2)
            self.assertEqual(NewStyleCopy2.allocated, 3)
            self.assertEqual(NewStyleCopy2.initialized, 1)
            self.assertIsNot(res, orig) # No cheating :)
        # Sending the object creates a second one on the far side
        d.addCallback(cb)
        return d

        Send a new style object and check the number of allocations.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/spread/test/test_pb.py