Mercurial > hgrepos > Python > libs > ConfigMix
diff tests/_perf_config.py @ 619:75ecbe07abff
Introduct a test context to more easily switch between some unittest configurations
| author | Franz Glasner <f.glasner@feldmann-mg.com> |
|---|---|
| date | Thu, 13 Jan 2022 11:39:38 +0100 |
| parents | 79db28e879f8 |
| children |
line wrap: on
line diff
--- a/tests/_perf_config.py Wed Jan 12 13:44:12 2022 +0100 +++ b/tests/_perf_config.py Thu Jan 13 11:39:38 2022 +0100 @@ -6,10 +6,7 @@ import sys import timeit -sys.path.insert( - 0, - os.path.abspath( - os.path.normpath(os.path.join(os.path.dirname(__file__), "..")))) +from _test_context import TESTDATADIR opts = sys.argv[1:] @@ -24,6 +21,8 @@ setup = """ import os +from _test_context import TESTDATADIR + import configmix from configmix.config import _HIER_SEPARATOR, \ py_quote, py_unquote, py_pathstr2path, \ @@ -33,12 +32,6 @@ except ImportError: fast_unquote = fast_quote = fast_pathstr2path = _fast_split_ns = None -TESTDATADIR = os.path.join( - os.path.abspath(os.path.dirname(configmix.__file__)), - "..", - "tests", - "data") - cfg = configmix.load(os.path.join(TESTDATADIR, "conf_perf.py")) se = u""
