From b9b24d74d7444fa3478298571c7265ace0419052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Thu, 7 Jan 2021 10:04:26 +0100 Subject: [PATCH 1/2] Use built-in unittest.mock Use built-in Python 3 unittest.mock instead of relying on mock package that is only necessary for ancient versions of Python. --- .github/workflows/test.yaml | 2 +- pymysql/tests/test_connection.py | 2 +- requirements-dev.txt | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8f53c28d..09846c94 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -56,7 +56,7 @@ jobs: - name: Install dependency run: | - pip install -U cryptography PyNaCl pytest pytest-cov mock coveralls + pip install -U cryptography PyNaCl pytest pytest-cov coveralls - name: Set up MySQL run: | diff --git a/pymysql/tests/test_connection.py b/pymysql/tests/test_connection.py index be4006f6..52b9ccf0 100644 --- a/pymysql/tests/test_connection.py +++ b/pymysql/tests/test_connection.py @@ -2,9 +2,9 @@ import ssl import sys import time -import mock import pytest import pymysql +from unittest import mock from pymysql.tests import base from pymysql.constants import CLIENT diff --git a/requirements-dev.txt b/requirements-dev.txt index 69d3f68a..d65512fb 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,3 @@ cryptography PyNaCl>=1.4.0 pytest -mock From 077eae0e593aba388809eba50aa5ba0a1948b11e Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Thu, 7 Jan 2021 22:18:54 +0900 Subject: [PATCH 2/2] Update test_connection.py --- pymysql/tests/test_connection.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pymysql/tests/test_connection.py b/pymysql/tests/test_connection.py index 52b9ccf0..75db73cd 100644 --- a/pymysql/tests/test_connection.py +++ b/pymysql/tests/test_connection.py @@ -1,10 +1,11 @@ import datetime import ssl import sys -import time import pytest -import pymysql +import time from unittest import mock + +import pymysql from pymysql.tests import base from pymysql.constants import CLIENT