aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Jinja2/py2/patches/02-fix-tests.patch
blob: c1bb11f8d8b4c05809efa8712180b2d6b4a7af31 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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"