File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 1+ import pytest
12import unittest
23import os , sys , shutil
34
@@ -23,6 +24,14 @@ def captured_output():
2324 finally :
2425 sys .stdout , sys .stderr = old_out , old_err
2526
27+ try :
28+ import jinja2
29+ skip_jinja2 = lambda func , * args , ** kwargs : func
30+ except ImportError :
31+ from .pytest_patcher import mark_class
32+ skip_jinja2 = mark_class (pytest .mark .skip (
33+ reason = 'Skipping Jinja2 tests: jinja2 library not available' ))
34+
2635class TestDemo (unittest .TestCase ):
2736 def setUp (self ):
2837 self .home = os .path .abspath ('_test_demo' )
@@ -73,6 +82,7 @@ def testDemoClassic(self):
7382 def testDemoMinimal (self ):
7483 self .run_install_demo ('../templates/minimal' , db = "sqlite" )
7584
85+ @skip_jinja2
7686 def testDemoJinja (self ):
7787 self .run_install_demo ('jinja2' , db = "anydbm" )
7888
You can’t perform that action at this time.
0 commit comments