Tests fail if unittest2 library is missing

Merges: https://pagure.io/pungi/pull-request/894
Signed-off-by: Ondrej Nosek <onosek@redhat.com>
This commit is contained in:
Ondrej Nosek 2018-04-06 15:28:33 +02:00 committed by Lubomír Sedlář
parent 6454f30714
commit 7798174b30
3 changed files with 12 additions and 6 deletions

View File

@ -20,7 +20,7 @@ from kobo.shortcuts import run
from kobo.pkgset import SimpleRpmWrapper, RpmWrapper from kobo.pkgset import SimpleRpmWrapper, RpmWrapper
from kobo.rpmlib import parse_nvra from kobo.rpmlib import parse_nvra
from pungi.util import rmtree, get_arch_variant_data, temp_dir from pungi.util import get_arch_variant_data, temp_dir
from pungi.wrappers.pungi import PungiWrapper from pungi.wrappers.pungi import PungiWrapper
from pungi.arch import tree_arch_to_yum_arch, get_valid_arches from pungi.arch import tree_arch_to_yum_arch, get_valid_arches

View File

@ -1,10 +1,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import itertools
import mock import mock
import os import os
import sys import sys
try:
import unittest2 as unittest import unittest2 as unittest
import itertools except ImportError:
import unittest
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))

View File

@ -1,12 +1,15 @@
#!/usr/bin/env python2 #!/usr/bin/env python2
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import json
import mock import mock
import os import os
import sys
import unittest2 as unittest
import json
import re import re
import sys
try:
import unittest2 as unittest
except ImportError:
import unittest
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))