Skip to content

Commit

Permalink
Move driver version check out of function
Browse files Browse the repository at this point in the history
  • Loading branch information
gordthompson authored and mkleehammer committed Mar 27, 2022
1 parent 8228dbc commit 9d84ef1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests3/pgtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,11 +561,11 @@ def test_cnxn_set_attr(self):


def test_columns(self):
driver_version = tuple(
int(x) for x in self.cnxn.getinfo(pyodbc.SQL_DRIVER_VER).split(".")
)

def _get_column_size(row):
driver_version = tuple(
int(x) for x in self.cnxn.getinfo(pyodbc.SQL_DRIVER_VER).split(".")
)
return row.column_size if driver_version >= (13, 2, 0) else row.precision

# When using aiohttp, `await cursor.primaryKeys('t1')` was raising the error
Expand Down

0 comments on commit 9d84ef1

Please sign in to comment.