Permalink
Browse files

allow running the tests on python 2.5

python 2.5 doesn't have the json module, re.sub doesn't take a flags
argument.
  • Loading branch information...
1 parent 48a82b2 commit 682db0bfeafa142d2efd31baa9ffe38bb94455dd @schmir schmir committed Jan 20, 2013
Showing with 10 additions and 2 deletions.
  1. +5 −2 conftest.py
  2. +5 −0 tox.ini
View
@@ -1,5 +1,8 @@
import re
-import json
+try:
+ import json
+except ImportError:
+ import simplejson as json
import pytest
@@ -12,7 +15,7 @@ def pytest_collect_file(path, parent):
def parse_test(raw):
- raw = re.sub('#.*$', '', raw, flags=re.M).strip()
+ raw = re.compile('#.*$', re.M).sub('', raw).strip()
if raw.startswith('"""'):
raw = raw[3:]
View
@@ -9,3 +9,8 @@ envlist = py25, py26, py27, py30, py31, py32, pypy
[testenv]
commands = py.test
deps = pytest
+
+[testenv:py25]
+commands = py.test
+deps = pytest
+ simplejson

0 comments on commit 682db0b

Please sign in to comment.