@skipIf((PSYCOPG2_VERSION < (2, 5)), 'context manager not available in psycopg2==2.4')
def test_cursor_ctx_manager(self):
    conn = self._get_conn()
    t = type(conn.cursor())
    with conn.cursor() as cur:
        assert (t == type(cur)), '{} != {}'.format(t, type(cur))
        cur.execute(query="select 'blah'")
        rows = cur.fetchall()
        assert (len(rows) == 1), rows
        assert (rows[0][0] == 'blah')
    assert_is_measured(self.get_root_span())
    self.assert_structure(dict(name='postgres.query'))
@skipIf((PSYCOPG2_VERSION < (2, 5)), 'context manager not available in psycopg2==2.4')
def test_cursor_ctx_manager(self):
    conn = self._get_conn()
    t = type(conn.cursor())
    with conn.cursor() as cur:
        assert (t == type(cur)), '{} != {}'.format(t, type(cur))
        cur.execute(query="select 'blah'")
        rows = cur.fetchall()
        assert (len(rows) == 1), rows
        assert (rows[0][0] == 'blah')
    assert_is_measured(self.get_root_span())
    self.assert_structure(dict(name='postgres.query'))