def test_fs():
"""A convenience fixture for retrieving data from test files"""
import pytest_pootle
class TestFs(object):
def path(self, path):
return os.path.join(
os.path.dirname(pytest_pootle.__file__),
path)
def open(self, paths, *args, **kwargs):
if isinstance(paths, (list, tuple)):
paths = os.path.join(*paths)
return open(self.path(paths), *args, **kwargs)
return TestFs()
评论列表
文章目录