Skip to content

Commit

Permalink
define tests only if jinja is older than 2.10
Browse files Browse the repository at this point in the history
this allows us to use the jinja versions if they are available
  • Loading branch information
jamescassell committed Nov 6, 2019
1 parent 9a5c47a commit 0423905
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/ansible/plugins/test/compat_jinja_2_10.py
Expand Up @@ -9,7 +9,9 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import jinja2
import operator
from distutils.version import LooseVersion


def test_in(value, seq):
Expand All @@ -27,6 +29,9 @@ class TestModule:
"""

def tests(self):
if LooseVersion(str(jinja2.__version__)) >= LooseVersion('2.10'):
return {}

return {
'in': test_in,
'==': operator.eq,
Expand Down

0 comments on commit 0423905

Please sign in to comment.