diff --git a/tests/papi/test_lz4.py b/tests/papi/test_lz4.py index 783cca6..43ab852 100644 --- a/tests/papi/test_lz4.py +++ b/tests/papi/test_lz4.py @@ -1,4 +1,23 @@ +from __future__ import unicode_literals +from distutils import dir_util from pytest import fixture +from os import path + + +@fixture +def datadir(tmpdir, request): + ''' + Fixture responsible for searching a folder with the same name of test + module and, if available, moving all contents to a temporary directory so + tests can use them freely. + ''' + filename = request.module.__file__ + test_dir, _ = path.splitext(filename) + + if path.isdir(test_dir): + dir_util.copy_tree(test_dir, bytes(tmpdir)) + + return tmpdir @fixture def lz4():