~jderose/degu/py3.10

« back to all changes in this revision

Viewing changes to degu/tests/test_base.py

  • Committer: Jason Gerard DeRose
  • Date: 2022-06-16 22:53:25 UTC
  • Revision ID: jasonderose@gmail.com-20220616225325-u10m4glv1ft3t47u
Ah ha, delete context manager before checking refcount, it's keeping a reference in Python3.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
6245
6245
        self.assertEqual(str(cm.exception),
6246
6246
            "'BadSocket1' object has no attribute 'recv_into'"
6247
6247
        )
6248
 
        self.assertEqual(sys.getrefcount(sock), 3)  # FIXME 2?
 
6248
        del cm
 
6249
        self.assertEqual(sys.getrefcount(sock), 2)
6249
6250
        self.assertEqual(sock._calls, ['close'])
6250
6251
 
6251
6252
        # no sock.send() attribute:
6259
6260
        self.assertEqual(str(cm.exception),
6260
6261
            "'BadSocket2' object has no attribute 'send'"
6261
6262
        )
6262
 
        self.assertEqual(sys.getrefcount(sock), 3)  # FIXME 2?
 
6263
        del cm
 
6264
        self.assertEqual(sys.getrefcount(sock), 2)
6263
6265
        self.assertEqual(sock._calls, ['close'])
6264
6266
 
6265
6267
        # sock.recv_into() isn't callable: