8000 Make tests run on Python 2.5. · woodcoder/flask-assets@5e2e859 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5e2e859

Browse files
committed
Make 8000 tests run on Python 2.5.
1 parent 096f12a commit 5e2e859

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

tests/helpers.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,18 @@ def _create_environment(self, **kwargs):
3535
self.app = Flask(__name__, static_folder 8000 =self.tempdir, **kwargs)
3636
self.env = Environment(self.app)
3737
return self.env
38+
39+
40+
41+
try:
42+
from test.test_support import check_warnings
43+
except ImportError:
44+
# Python < 2.6
45+
import contextlib
46+
47+
@contextlib.contextmanager
48+
def check_warnings(*filters, **kwargs):
49+
# We cannot reasonably support this, we'd have to copy to much code.
50+
# (or write our own). Since this is only testing warnings output,
51+
# we might slide by ignoring it.
52+
yield

tests/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""
33

44
from __future__ import with_statement
5-
from test.test_support import check_warnings
5+
from helpers import check_warnings
66

77
from nose.tools import assert_raises
88
from flask import Flask

0 commit comments

Comments
 (0)
0