Make python3-mock dependency optional
https://fedoraproject.org/wiki/Changes/RemovePythonMockUsage
Prefer using unittest.mock to a standalone package. The separate
packages should only really be needed on Python 2.7 these days.
The test requirements file is updated to only require mock on old
Python, and the dependency is removed from setup.py to avoid issues
there.
Relates: https://src.fedoraproject.org/rpms/pungi/pull-request/9
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
(cherry picked from commit ff5a7e6377
)
This commit is contained in:
parent
a9839d8078
commit
d8a553163f
2
setup.py
2
setup.py
@ -66,5 +66,5 @@ setup(
|
||||
"dogpile.cache",
|
||||
],
|
||||
extras_require={':python_version=="2.7"': ["enum34", "lockfile"]},
|
||||
tests_require=["mock", "pytest", "pytest-cov", "pyfakefs"],
|
||||
tests_require=["pytest", "pytest-cov", "pyfakefs"],
|
||||
)
|
||||
|
@ -1,4 +1,4 @@
|
||||
mock
|
||||
mock; python_version < '3.3'
|
||||
parameterized
|
||||
pytest
|
||||
pytest-cov
|
||||
|
@ -1,4 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import ddt
|
||||
from unittest import mock
|
||||
import os
|
||||
|
@ -1,7 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import json
|
||||
|
||||
import unittest
|
||||
from unittest import mock
|
||||
import os
|
||||
import re
|
||||
import six
|
||||
@ -10,13 +11,6 @@ from typing import AnyStr, List, Set, Dict, Tuple
|
||||
|
||||
from tests.test_gather_method_hybrid import MockModule
|
||||
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
from unittest2 import mock
|
||||
except ImportError:
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
||||
from pungi.phases.pkgset.sources import source_koji, source_kojimock
|
||||
from tests import helpers
|
||||
from pungi.module_util import Modulemd
|
||||
|
Loading…
Reference in New Issue
Block a user