Skip to content

Commit c71267c

Browse files
bladamsramiro
authored andcommitted
improved sqlalchemy test config handling
1 parent 2f2f27f commit c71267c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tests/run_sqlalchemy_tests.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,20 @@ def run_sqlalchemy_tests():
4040

4141
def get_dburi():
4242
config = ConfigParser.SafeConfigParser()
43-
config.read('tests/tests.cfg')
43+
44+
config.read(os.path.join(os.path.dirname(__file__), 'tests.cfg'))
4445

4546
username = config.get('DEFAULT', 'username')
4647
password = config.get('DEFAULT', 'password')
4748
server = config.get('DEFAULT', 'server')
49+
port = config.get('DEFAULT', 'port')
4850
database = config.get('DEFAULT', 'database')
4951

50-
return 'mssql+pymssql://%(username)s:%(password)s@%(server)s/%(database)s' % dict(
52+
return 'mssql+pymssql://%(username)s:%(password)s@%(server)s:%(port)s/%(database)s' % dict(
5153
username=username,
5254
password=password,
5355
server=server,
56+
port=port,
5457
database=database)
5558

5659

0 commit comments

Comments
 (0)