summaryrefslogtreecommitdiff
path: root/tests/support.py
blob: 9e02a282ee2a23e63e49712c0d5ac032043229b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
import os


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)