Skip to content

Commit c3e117d

Browse files
authored
Merge branch 'master' into fix/issue-191
2 parents dc4b14c + bd4b0e5 commit c3e117d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

README.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Support it
4343
*Star* the project on GitHub, *Buy Me a Coffee* clicking the button below or, even better, contribute with patches or documentation.
4444

4545
.. image:: https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png
46-
:target: https://www.buymeacoffee.com/mULbInw5z
46+
:target: https://www.buymeacoffee.com/mocket
4747
:alt: Buy Me A Coffee
4848

4949
How to use it
@@ -54,6 +54,7 @@ Read the following blog posts if you want to have a big picture of what *Mocket*
5454
- https://hackernoon.com/make-development-great-again-faab769d264e
5555
- https://hackernoon.com/httpretty-now-supports-asyncio-e310814704c6
5656
- https://medium.com/@mindflayer/how-to-make-your-tests-fail-when-they-try-to-access-the-network-python-eb80090a6d24
57+
- https://medium.com/@mindflayer/testing-in-an-asyncio-world-a9a0ad41b0c5
5758

5859
The starting point to understand how to use *Mocket* to write a custom mock is the following example:
5960

mocket/mocket.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,11 @@ def create_connection(address, timeout=None, source_address=None):
137137
return s
138138

139139

140-
def socketpair():
140+
def socketpair(*args, **kwargs):
141141
"""Returns a real socketpair() used by asyncio loop for supporting calls made by fastapi and similar services."""
142142
import _socket
143143

144-
return _socket.socketpair()
144+
return _socket.socketpair(*args, **kwargs)
145145

146146

147147
def _hash_request(h, req):

0 commit comments

Comments
 (0)