pycontribs / jenkinsapi

A Python API for accessing resources and configuring Hudson & Jenkins continuous-integration servers
http://pypi.python.org/pypi/jenkinsapi
MIT License
857 stars 483 forks source link

modernize tests #819

Closed pgajdos closed 1 year ago

pgajdos commented 2 years ago

Could you please consider to use unittest.mock instead of mock, as a fallback at least? Also, auto_spec will not work with python 3.10, autospec will instead.

Following works for me for 3.8, 3.9 and 3.10:

sed -i -e 's:import mock:from unittest import mock:' \
       -e 's:from mock:from unittest.mock:' \
       -e 's:mock.mock:unittest.mock:' \
       -e 's:auto_spec:autospec:' \
       jenkinsapi_tests/unittests/test_*.py
lechat commented 1 year ago

autospec is fixed, I will leave mock for now.