diff options
author | Andrej Shadura <andrewsh@debian.org> | 2018-11-05 14:44:38 +0100 |
---|---|---|
committer | Andrej Shadura <andrewsh@debian.org> | 2018-11-05 14:44:38 +0100 |
commit | 59c3ccc50d3504bfeb1a3f7e31ba806e2b5c3a07 (patch) | |
tree | 8021d433dbbd4dc2cff52ea33de8d61625d444cd /tests/support.py | |
parent | d8736ad37771257f5e8090072fccfbac90098633 (diff) |
New upstream version 0.19
Diffstat (limited to 'tests/support.py')
-rw-r--r-- | tests/support.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/support.py b/tests/support.py index fe381f5..9e02a28 100644 --- a/tests/support.py +++ b/tests/support.py @@ -1,9 +1,11 @@ import os -def open_file(filename): - ''' Load a file from the fixtures directory. ''' - path = 'fixtures/' + filename - if ('tests' in os.listdir('.')): - path = 'tests/' + path - return open(path, mode='rb') +def open_file(filename, mode='rb'): + """ + Load a file from the fixtures directory. + """ + path = os.path.join('fixtures', filename) + if 'tests' in os.listdir('.'): + path = os.path.join('tests', path) + return open(path, mode=mode) |