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:
Lubomír Sedlář 2016-05-25 13:39:02 +02:00
parent b634a18a7f
commit d5512fd6ff
15 changed files with 60 additions and 16 deletions

View file

@ -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