Use unittest2 if available
The module backports features to Python 2.6 and 2.7. If it is available, the tests will use it. If it is not available, it will fall back to regular unittest. On Python 2.7, the tests pass anyway. On Python 2.6, there are failures with Python 2.6. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
b634a18a7f
commit
d5512fd6ff
@ -2,7 +2,10 @@
|
||||
|
||||
import mock
|
||||
import os
|
||||
import unittest
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
except ImportError:
|
||||
import unittest
|
||||
import tempfile
|
||||
import shutil
|
||||
import errno
|
||||
|
@ -2,7 +2,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
import unittest
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
except ImportError:
|
||||
import unittest
|
||||
import mock
|
||||
|
||||
import os
|
||||
|
@ -2,7 +2,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import mock
|
||||
import unittest
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
except ImportError:
|
||||
import unittest
|
||||
import os
|
||||
import sys
|
||||
import StringIO
|
||||
|
@ -2,7 +2,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import mock
|
||||
import unittest
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
except ImportError:
|
||||
import unittest
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
|
@ -2,7 +2,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
import unittest
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
except ImportError:
|
||||
import unittest
|
||||
import mock
|
||||
|
||||
import os
|
||||
|
@ -1,7 +1,10 @@
|
||||
#!/usr/bin/env python2
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import unittest
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
except ImportError:
|
||||
import unittest
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
@ -2,7 +2,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
import unittest
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
except ImportError:
|
||||
import unittest
|
||||
import mock
|
||||
|
||||
import os
|
||||
|
@ -2,7 +2,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
import unittest
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
except ImportError:
|
||||
import unittest
|
||||
import mock
|
||||
|
||||
import os
|
||||
|
@ -1,8 +1,10 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
import unittest
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
except ImportError:
|
||||
import unittest
|
||||
import mock
|
||||
|
||||
import os
|
||||
|
@ -2,7 +2,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import mock
|
||||
import unittest
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
except ImportError:
|
||||
import unittest
|
||||
import tempfile
|
||||
|
||||
import os
|
||||
|
@ -1,7 +1,10 @@
|
||||
#!/usr/bin/env python2
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import unittest
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
except ImportError:
|
||||
import unittest
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
@ -4,7 +4,10 @@
|
||||
import mock
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
except ImportError:
|
||||
import unittest
|
||||
import json
|
||||
import tempfile
|
||||
|
||||
|
@ -2,7 +2,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import mock
|
||||
import unittest
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
except ImportError:
|
||||
import unittest
|
||||
import shutil
|
||||
import tempfile
|
||||
|
||||
|
@ -2,7 +2,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
import unittest
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
except ImportError:
|
||||
import unittest
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
@ -4,7 +4,10 @@
|
||||
import mock
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
except ImportError:
|
||||
import unittest
|
||||
import tempfile
|
||||
import shutil
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user