aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Jinja2/py3/patches/02-fix-tests.patch
diff options
context:
space:
mode:
authorDevtools Arcadia <arcadia-devtools@yandex-team.ru>2022-02-07 18:08:42 +0300
committerDevtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net>2022-02-07 18:08:42 +0300
commit1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch)
treee26c9fed0de5d9873cce7e00bc214573dc2195b7 /contrib/python/Jinja2/py3/patches/02-fix-tests.patch
downloadydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'contrib/python/Jinja2/py3/patches/02-fix-tests.patch')
-rw-r--r--contrib/python/Jinja2/py3/patches/02-fix-tests.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/contrib/python/Jinja2/py3/patches/02-fix-tests.patch b/contrib/python/Jinja2/py3/patches/02-fix-tests.patch
new file mode 100644
index 00000000000..d23c1d80963
--- /dev/null
+++ b/contrib/python/Jinja2/py3/patches/02-fix-tests.patch
@@ -0,0 +1,69 @@
+--- contrib/python/Jinja2/py3/tests/conftest.py (index)
++++ contrib/python/Jinja2/py3/tests/conftest.py (working tree)
+@@ -27,7 +27,8 @@ def package_loader():
+ @pytest.fixture
+ def filesystem_loader():
+ """returns FileSystemLoader initialized to res/templates directory"""
+- here = Path(__file__).parent.resolve()
++ import yatest.common
++ here = Path(yatest.common.test_source_path())
+ return loaders.FileSystemLoader(here / "res" / "templates")
+
+
+--- contrib/python/Jinja2/py3/tests/test_loader.py (index)
++++ contrib/python/Jinja2/py3/tests/test_loader.py (working tree)
+@@ -18,6 +18,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:
+ def test_dict_loader(self, dict_loader):
+@@ -118,7 +120,7 @@ class TestLoaders(object):
+
+
+ class TestFileSystemLoader:
+- searchpath = (Path(__file__) / ".." / "res" / "templates").resolve()
++ searchpath = (Path(yc.test_source_path()) / "res" / "templates").resolve()
+
+ @staticmethod
+ def _test_common(env):
+@@ -146,6 +148,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)
+
+@@ -316,7 +319,7 @@ def test_package_dir_list(package_dir_loader):
+ @pytest.fixture()
+ def package_file_loader(monkeypatch):
+ monkeypatch.syspath_prepend(Path(__file__).parent / "res")
+- return PackageLoader("__init__")
++ return PackageLoader("res")
+
+
+ @pytest.mark.parametrize(
+@@ -337,7 +340,7 @@ def test_package_dir_list(package_dir_loader):
+
+ @pytest.fixture()
+ def package_zip_loader(monkeypatch):
+- package_zip = (Path(__file__) / ".." / "res" / "package.zip").resolve()
++ package_zip = (Path(yc.test_source_path()) / "res" / "package.zip").resolve()
+ monkeypatch.syspath_prepend(package_zip)
+ return PackageLoader("t_pack")
+
+--- contrib/python/Jinja2/py3/tests/test_utils.py (index)
++++ contrib/python/Jinja2/py3/tests/test_utils.py (working tree)
+@@ -110,7 +110,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"
+