Skip to content

Commit 85ef449

Browse files
committed
Update README with PR feedback changes.
1 parent f37de1e commit 85ef449

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

README.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ time setting up a complex mechanism to mock or patch the underlying Python
7878
modules dealing with the actual HTTP request (of which there are more than one
7979
BTW). So what do you do?
8080

81-
You simply use pytest's `funcargs feature`_ and simulate an entire server
82-
locally! :
81+
You simply use pytest's `fixture feature`_ and simulate an entire server
82+
locally!
8383

8484
.. code:: python
8585
@@ -107,10 +107,10 @@ The same thing works for SMTP servers, too:
107107
def test_sending_some_message(smtpserver):
108108
mailer = MyMailer(host=smtpserver.addr[0], port=smtpserver.addr[1])
109109
mailer.send(
110-
111-
112-
subject="MyMailer v1.0",
113-
body="Check out my mailer!"
110+
111+
112+
subject="MyMailer v1.0",
113+
body="Check out my mailer!"
114114
)
115115
assert len(smtpserver.outbox)==1
116116
@@ -144,11 +144,11 @@ suggest poking around in the code itself.
144144
.. code:: python
145145
146146
httpserver.serve_content(
147-
content=None,
148-
code=200,
149-
headers=None,
150-
chunked=pytest_localserver.http.Chunked.NO,
151-
store_request_data=True
147+
content=None,
148+
code=200,
149+
headers=None,
150+
chunked=pytest_localserver.http.Chunked.NO,
151+
store_request_data=True
152152
)
153153
154154
The ``chunked`` attribute or parameter can be set to
@@ -219,7 +219,7 @@ server :
219219
return ["success".encode("utf-8")]
220220
221221
222-
@pytest.yield_fixture
222+
@pytest.fixture
223223
def testserver():
224224
"""Server for simple_app."""
225225
server = WSGIServer(application=simple_app)
@@ -315,9 +315,9 @@ For package maintainers, here is how we release a new version:
315315
Having unsuccessfully tried to mock a server, I stumbled across
316316
`linkchecker`_ which uses a the same idea to test its internals.
317317
318-
.. _monkeypatching: http://pytest.org/latest/monkeypatch.html
318+
.. _monkeypatching: https://docs.pytest.org/en/stable/how-to/monkeypatch.html
319319
.. _pytest: http://pytest.org/
320-
.. _funcargs feature: http://pytest.org/latest/funcargs.html
320+
.. _fixture feature: https://pytest.org/en/stable/explanation/fixtures.html
321321
.. _linkchecker: http://linkchecker.sourceforge.net/
322322
.. _WSGI application: http://www.python.org/dev/peps/pep-0333/
323323
.. _PyPI: http://pypi.python.org/pypi/pytest-localserver/

0 commit comments

Comments
 (0)