Enable running of tests in tests/db_engine_specs (#8902)

* Enable running of tests in tests/db_engine_specs

* Resolve application context errors

* Refactor and add tests for pyodbc.Row conversion

* Appease isort, regardless of isort:skip
This commit is contained in:
Rob DiCiuccio
2019-12-31 12:45:33 +00:00
committed by Ville Brofeldt
parent 5b690f9411
commit 8fc814fc62
8 changed files with 77 additions and 7 deletions

View File

@@ -63,9 +63,8 @@ class MssqlEngineSpec(BaseEngineSpec):
@classmethod
def fetch_data(cls, cursor, limit: int) -> List[Tuple]:
data = super().fetch_data(cursor, limit)
if data and type(data[0]).__name__ == "Row":
data = [tuple(row) for row in data]
return data
# Lists of `pyodbc.Row` need to be unpacked further
return cls.pyodbc_rows_to_tuples(data)
column_types = [
(String(), re.compile(r"^(?<!N)((VAR){0,1}CHAR|TEXT|STRING)", re.IGNORECASE)),