DB: SQL Server Microsoft SQL Server 2019 (RTM-CU14) (KB5007182) - 15.0.4188.2 (X64) Developer Edition (64-bit) on Linux (Ubuntu 20.04.3 LTS)
driver: freetds stable 1.3.6
Issue
The test_drivers() method in tests3/sqlservertests.py assumes that the regular expression DRIVER={?([^}]+?)}?; will always find a match in the output of pyodbc.drivers(). That assumption causes the test to fail when (for example) the output of pyodbc.drivers() is ['FreeTDS', 'PostgreSQL', 'SQLite'].
======================================================================
ERROR: test_drivers (__main__.SqlServerTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/bkline/repos/pyodbc/tests3/sqlservertests.py", line 1659, in test_drivers
current = m.group(1)
AttributeError: 'NoneType' object has no attribute 'group'
Environment
Issue
The
test_drivers()
method intests3/sqlservertests.py
assumes that the regular expressionDRIVER={?([^}]+?)}?;
will always find a match in the output ofpyodbc.drivers()
. That assumption causes the test to fail when (for example) the output ofpyodbc.drivers()
is['FreeTDS', 'PostgreSQL', 'SQLite']
.