summaryrefslogtreecommitdiff
path: root/tests/support.py
diff options
context:
space:
mode:
authorAndrej Shadura <andrewsh@debian.org>2018-11-05 14:44:38 +0100
committerAndrej Shadura <andrewsh@debian.org>2018-11-05 14:44:38 +0100
commit4d73449bab819dddc8e7f52ddf01b6bacd2a7e40 (patch)
tree992d9135cdaf62c13cf05fb6bc73628b1d5c7577 /tests/support.py
parent8f6a863fcd6a0518ea8e3e1e863346553d0250ba (diff)
parent59c3ccc50d3504bfeb1a3f7e31ba806e2b5c3a07 (diff)
Update upstream source from tag 'upstream/0.19'
Update to upstream version '0.19' with Debian dir 0cc2866dc4222e919db114429121a55eadb99c77
Diffstat (limited to 'tests/support.py')
-rw-r--r--tests/support.py14
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)