Added support for recent CPython and PyPy versions; Droped Python v2.7 Support (#680)

This commit is contained in:
Andreas Motl
2022-10-08 02:28:36 +02:00
committed by GitHub
parent f7244cce3d
commit 00afe4e5b6
164 changed files with 746 additions and 2787 deletions

View File

@ -23,13 +23,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
try:
# Python 3.x
from unittest import mock
except ImportError:
# Python 2.7
import mock
from unittest import mock
import requests
from json import dumps
@ -271,21 +265,6 @@ def test_plugin_twist_auth(mock_post, mock_get):
# Calling logout on an object already logged out
obj.logout()
# Force a token (to imply we've logged in)
obj.token = 'abc'
mock_post.return_value.status_code = requests.codes.ok
mock_get.return_value.status_code = requests.codes.ok
# Test Python v3.5 LookupError Bug: https://bugs.python.org/issue29288
mock_post.side_effect = LookupError()
mock_get.side_effect = LookupError()
obj.access_token = 'abc'
obj.user_id = '123'
# Tidy object
del obj
@mock.patch('requests.get')
@mock.patch('requests.post')