diff options
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) |