diff options
author | Devtools Arcadia <arcadia-devtools@yandex-team.ru> | 2022-02-07 18:08:42 +0300 |
---|---|---|
committer | Devtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net> | 2022-02-07 18:08:42 +0300 |
commit | 1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch) | |
tree | e26c9fed0de5d9873cce7e00bc214573dc2195b7 /contrib/python/Jinja2/py2/patches/02-fix-tests.patch | |
download | ydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz |
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'contrib/python/Jinja2/py2/patches/02-fix-tests.patch')
-rw-r--r-- | contrib/python/Jinja2/py2/patches/02-fix-tests.patch | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/contrib/python/Jinja2/py2/patches/02-fix-tests.patch b/contrib/python/Jinja2/py2/patches/02-fix-tests.patch new file mode 100644 index 0000000000..c1bb11f8d8 --- /dev/null +++ b/contrib/python/Jinja2/py2/patches/02-fix-tests.patch @@ -0,0 +1,54 @@ +--- contrib/python/Jinja2/py2/tests/conftest.py (index) ++++ contrib/python/Jinja2/py2/tests/conftest.py (working tree) +@@ -35,7 +35,11 @@ def package_loader(): + @pytest.fixture + def filesystem_loader(): + """returns FileSystemLoader initialized to res/templates directory""" +- here = os.path.dirname(os.path.abspath(__file__)) ++ try: ++ import yatest.common ++ here = yatest.common.test_source_path() ++ except ImportError: ++ here = os.path.dirname(os.path.abspath(__file__)) + return loaders.FileSystemLoader(here + "/res/templates") + + +--- contrib/python/Jinja2/py2/tests/test_loader.py (index) ++++ contrib/python/Jinja2/py2/tests/test_loader.py (working tree) +@@ -15,6 +15,8 @@ from jinja2._compat import PYPY + from jinja2.exceptions import TemplateNotFound + from jinja2.loaders import split_template_path + ++import yatest.common as yc ++ + + class TestLoaders(object): + def test_dict_loader(self, dict_loader): +@@ -117,7 +119,7 @@ class TestLoaders(object): + + class TestFileSystemLoader(object): + searchpath = os.path.join( +- os.path.dirname(os.path.abspath(__file__)), "res", "templates" ++ yc.test_source_path(), "res", "templates" + ) + + @staticmethod +@@ -156,6 +158,7 @@ class TestFileSystemLoader(object): + env = Environment(loader=filesystem_loader) + self._test_common(env) + ++ @pytest.mark.skip("Arcadia read only") + def test_caches_template_based_on_mtime(self): + filesystem_loader = loaders.FileSystemLoader(self.searchpath) + +--- contrib/python/Jinja2/py2/tests/test_utils.py (index) ++++ contrib/python/Jinja2/py2/tests/test_utils.py (working tree) +@@ -125,7 +125,7 @@ class TestHelpers(object): + + assert object_type_repr(42) == "int object" + assert object_type_repr([]) == "list object" +- assert object_type_repr(X()) == "test_utils.X object" ++ assert object_type_repr(X()) == "__tests__.test_utils.X object" + assert object_type_repr(None) == "None" + assert object_type_repr(Ellipsis) == "Ellipsis" + |