Skip to content

Commit

Permalink
fixing flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfunley committed May 27, 2022
1 parent 1ecb97d commit 4819e84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pugsql/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _add_path(self, sqlpath, encoding=None):
if not os.path.isdir(sqlpath):
raise ValueError('Directory not found: %s' % sqlpath)

for sqlfile in glob(os.path.join(sqlpath, '*sql')):
for sqlfile in sorted(glob(os.path.join(sqlpath, '*sql'))):
with open(sqlfile, 'r', encoding=encoding) as f:
pugsql = f.read()

Expand Down
4 changes: 2 additions & 2 deletions tests/test_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ def test_sets_sqlpaths(self):

def test_function_redefinition(self):
msg = (
'Error loading tests/sql/duplicate-name/foo.sql - a SQL function '
'Error loading tests/sql/duplicate-name/foo2.sql - a SQL function '
'named foo was already defined in '
'tests/sql/duplicate-name/foo2.sql.')
'tests/sql/duplicate-name/foo.sql.')
with pytest.raises(ValueError, match=msg):
compiler.Module('tests/sql/duplicate-name')

Expand Down

0 comments on commit 4819e84

Please sign in to comment.