diff options
author | maxim-yurchuk <maxim-yurchuk@yandex-team.com> | 2024-10-09 12:29:46 +0300 |
---|---|---|
committer | maxim-yurchuk <maxim-yurchuk@yandex-team.com> | 2024-10-09 13:14:22 +0300 |
commit | 9731d8a4bb7ee2cc8554eaf133bb85498a4c7d80 (patch) | |
tree | a8fb3181d5947c0d78cf402aa56e686130179049 /contrib/python/Jinja2/py2/patches/02-fix-tests.patch | |
parent | a44b779cd359f06c3ebbef4ec98c6b38609d9d85 (diff) | |
download | ydb-9731d8a4bb7ee2cc8554eaf133bb85498a4c7d80.tar.gz |
publishFullContrib: true for ydb
<HIDDEN_URL>
commit_hash:c82a80ac4594723cebf2c7387dec9c60217f603e
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" + |