def test_enter(self, _open): connection = BaseConnection(TEST_URL) retval = connection.__enter__() _open.assert_called_once_with() self.assertEqual(connection, retval)