From 5928b8e3838ad784e1376735aae784402ce272f6 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 22 Oct 2015 17:44:03 +0200 Subject: [PATCH 1/2] [test] fix Data folder --- test/test_compilation/test_compilation.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/test_compilation/test_compilation.py b/test/test_compilation/test_compilation.py index 07a0857d..c46844d5 100644 --- a/test/test_compilation/test_compilation.py +++ b/test/test_compilation/test_compilation.py @@ -2,14 +2,13 @@ # pylint: disable=too-few-public-methods -from pkg_resources import resource_filename import glob import os import subprocess import unittest from patacrep.encoding import open_read -import patacrep +from patacrep import __DATADIR__ from .. import dynamic # pylint: disable=unused-import @@ -101,7 +100,7 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): expected = expected.replace( "@DATA_FOLDER@", - os.path.abspath(resource_filename(patacrep.__name__, 'data')), + __DATADIR__, ) return super().assertMultiLineEqual(result, expected, msg) From b60a32d269cd1d2841755da959ef73d781ed0592 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 22 Oct 2015 18:14:32 +0200 Subject: [PATCH 2/2] [test] fix Data folder via system call --- test/test_compilation/test_compilation.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/test_compilation/test_compilation.py b/test/test_compilation/test_compilation.py index c46844d5..ca94400e 100644 --- a/test/test_compilation/test_compilation.py +++ b/test/test_compilation/test_compilation.py @@ -8,7 +8,6 @@ import subprocess import unittest from patacrep.encoding import open_read -from patacrep import __DATADIR__ from .. import dynamic # pylint: disable=unused-import @@ -98,9 +97,13 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): os.path.dirname(__file__), ) + datadir_command = ['python', '-c', 'from patacrep import __DATADIR__; print(__DATADIR__)'] + stdout = subprocess.check_output(datadir_command) + datadir = stdout.decode("utf-8").strip() + expected = expected.replace( "@DATA_FOLDER@", - __DATADIR__, + datadir, ) return super().assertMultiLineEqual(result, expected, msg)