From 1193cd6d8746f52eab7dc247bb00e3e90048392d Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Mon, 3 Jul 2017 17:30:25 +0100 Subject: [PATCH] add unitest2 to support assertRaisesRegexp on 2.6 --- test_spec.py | 7 ++++++- tox.ini | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/test_spec.py b/test_spec.py index a02819e..3c476db 100755 --- a/test_spec.py +++ b/test_spec.py @@ -1,12 +1,17 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -import unittest import os import json import chevron +import sys +if sys.version_info < (2, 7): + import unittest2 as unittest +else: + import unittest + SPECS_PATH = os.path.join('spec', 'specs') SPECS = [path for path in os.listdir(SPECS_PATH) if path.endswith('.json')] STACHE = chevron.render diff --git a/tox.ini b/tox.ini index 4814333..f051395 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ envlist = py26, py27, py32, py33, py34, py35, pypy, flake8 [testenv] -deps = coverage +deps = coverage,unitest2 commands = coverage run --source={toxinidir}/chevron {toxinidir}/test_spec.py coverage report -m @@ -12,4 +12,4 @@ commands = python {toxinidir}/test_spec.py [testenv:flake8] deps = flake8 -commands = flake8 \ No newline at end of file +commands = flake8