def test_enterClosesFileExitOpensFile(self):
        """
        Entering a reservation closes its file for the duration of the
        context manager's block.
        """
        self.reservedFD.reserve()
        self.assertTrue(self.reservedFD.available())
        with self.reservedFD:
            self.assertFalse(self.reservedFD.available())
        self.assertTrue(self.reservedFD.available())

        Entering a reservation closes its file for the duration of the
        context manager's block.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_tcp.py