Skip to content

Commit

Permalink
Support opening files as text streams on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tonnydourado committed Nov 26, 2016
1 parent a4f14c4 commit c3f9479
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/support.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import os


def open_file(filename):
def open_file(filename, mode='rb'):
''' Load a file from the fixtures directory. '''
path = 'fixtures/' + filename
if ('tests' in os.listdir('.')):
path = 'tests/' + path
return open(path, mode='rb')
return open(path, mode=mode)

0 comments on commit c3f9479

Please sign in to comment.