jenkins-job-builder/tests/cmd
Adam Romanek 118ac858c4 tests: fix mixed imports of 'unittest.mock' and 'mock'
The 'mock' package is imported in 'tests.base'. Whenever possible
'tests.base' prefers 'unittest.mock' over 'mock' (which is the case on
Python 3.3+). Importing 'mock' together with 'unittest.mock' causes
unexpected behavior that results in exceptions when running tests, at
least on Python 3.6.12, like:

>  File "/usr/lib/python3.6/unittest/mock.py", line 1196, in patched
>    patching.__exit__(*exc_info)
>
>  File "/home/zuul/src/opendev.org/jjb/jenkins-job-builder/.tox/cover/lib/python3.6/site-packages/mock/mock.py", line 1545, in __exit__
>    return exit_stack.__exit__(*exc_info)
>
>  File "/usr/lib/python3.6/contextlib.py", line 339, in __exit__
>    received_exc = exc_details[0] is not None
>
>  IndexError: tuple index out of range

From now on, to avoid similar issues in the future, the 'mock' package
is only installed for Python 2.x.

Change-Id: Ib3044312f0770735d88d8657d1f953e5a33e771f
2021-01-01 12:58:28 +01:00
..
fixtures Removed the unnecessary empty combinationFilter Tag 2020-07-07 11:32:51 +02:00
subcommands Fix flake8 BLK100 and BLK999 issues 2020-08-31 10:54:19 -04:00
__init__.py tests for JJB command processing 2014-07-09 08:55:10 -07:00
test_cmd.py Auto-generated output from python-black 2019-09-09 19:23:24 +01:00
test_config.py tests: fix mixed imports of 'unittest.mock' and 'mock' 2021-01-01 12:58:28 +01:00
test_recurse_path.py Auto-generated output from python-black 2019-09-09 19:23:24 +01:00