Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use unittest.mock instead of mock where possible #200

Open
pgajdos opened this issue May 4, 2022 · 1 comment
Open

use unittest.mock instead of mock where possible #200

pgajdos opened this issue May 4, 2022 · 1 comment

Comments

@pgajdos
Copy link

pgajdos commented May 4, 2022

Could you please allow to drop python-mock dependency if not needed? Following works for 3.8, 3.9 and 3.10 but obviously will not be usable for Python 2.

diff -upr python-smpplib-2.2.1.orig/smpplib/tests/test_client.py python-smpplib-2.2.1/smpplib/tests/test_client.py
--- python-smpplib-2.2.1.orig/smpplib/tests/test_client.py	2022-05-04 09:38:34.127959320 +0200
+++ python-smpplib-2.2.1/smpplib/tests/test_client.py	2022-05-04 09:38:34.147959444 +0200
@@ -1,6 +1,6 @@
 import warnings
 import pytest
-from mock import Mock, call
+from unittest.mock import Mock, call
 
 from smpplib.client import Client
 from smpplib.smpp import make_pdu
diff -upr python-smpplib-2.2.1.orig/smpplib/tests/test_gsm.py python-smpplib-2.2.1/smpplib/tests/test_gsm.py
--- python-smpplib-2.2.1.orig/smpplib/tests/test_gsm.py	2022-05-04 09:38:34.127959320 +0200
+++ python-smpplib-2.2.1/smpplib/tests/test_gsm.py	2022-05-04 09:38:34.147959444 +0200
@@ -1,6 +1,6 @@
 # -*- coding: utf8 -*-
 
-import mock
+from unittest import mock
 from pytest import mark, raises
 
 from smpplib import consts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants