summaryrefslogtreecommitdiff
path: root/functionaltests
diff options
context:
space:
mode:
authorfuzzyman <devnull@localhost>2010-02-27 21:03:39 +0000
committerfuzzyman <devnull@localhost>2010-02-27 21:03:39 +0000
commit3ae5465a3129213d97b53a5eca5bf79c07033b57 (patch)
treee988015c56847b069b4fff6a8139d0a21598631d /functionaltests
parent045d26e83cafc87e1da5d7960f1cadc88696b20e (diff)
downloadconfigobj-git-3ae5465a3129213d97b53a5eca5bf79c07033b57.tar.gz
Removing 2.2 compatibility code, a validate test that doesn't pass and using unittest2 where available.
Diffstat (limited to 'functionaltests')
-rw-r--r--functionaltests/test_configobj.py7
-rw-r--r--functionaltests/test_validate_errors.py8
2 files changed, 11 insertions, 4 deletions
diff --git a/functionaltests/test_configobj.py b/functionaltests/test_configobj.py
index 31e63d9..437b5a9 100644
--- a/functionaltests/test_configobj.py
+++ b/functionaltests/test_configobj.py
@@ -1,9 +1,14 @@
from __future__ import with_statement
import os
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
+
from configobj import ConfigObj
+# Python 2.6 only
from warnings import catch_warnings
diff --git a/functionaltests/test_validate_errors.py b/functionaltests/test_validate_errors.py
index ed85ec3..4517817 100644
--- a/functionaltests/test_validate_errors.py
+++ b/functionaltests/test_validate_errors.py
@@ -1,5 +1,9 @@
import os
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
+
from configobj import ConfigObj, get_extra_values
from validate import Validator
@@ -58,7 +62,5 @@ class TestValidateErrors(unittest.TestCase):
])
self.assertEqual(sorted(extra_values), expected)
-
-
if __name__ == '__main__':
unittest.main()