@@ -183,7 +183,7 @@ If you need to support Python 3.5, which doesn't allow ``yield``
183
183
inside an ``async def `` function, then you can define async fixtures
184
184
using the `async_generator
185
185
<https://async-generator.readthedocs.io/en/latest/reference.html> `__
186
- library – just make sure to put the ``@pytest.fixture `` *above * the
186
+ library - just make sure to put the ``@pytest.fixture `` *above * the
187
187
``@async_generator ``.
188
188
189
189
@@ -232,7 +232,7 @@ Here's a first attempt::
232
232
233
233
This will mostly work, but it has a few problems. The most obvious one
234
234
is that when we run it, even if everything works perfectly, it will
235
- hang at the end of the test – we never shut down the server, so the
235
+ hang at the end of the test - we never shut down the server, so the
236
236
nursery block will wait forever for it to exit.
237
237
238
238
To avoid this, we should cancel the nursery at the end of the test:
@@ -292,9 +292,9 @@ you afterwards:
292
292
Next problem: we have a race condition. We spawn a background task to
293
293
call ``serve_tcp ``, and then immediately try to connect to that
294
294
server. Sometimes this will work fine. But it takes a little while for
295
- the server to start up and be ready to accept connections – so other
295
+ the server to start up and be ready to accept connections - so other
296
296
times, randomly, our connection attempt will happen too quickly, and
297
- error out. After all – ``nursery.start_soon `` only promises that the
297
+ error out. After all - ``nursery.start_soon `` only promises that the
298
298
task will be started *soon *, not that it has actually happened. So this
299
299
test will be flaky, and flaky tests are the worst.
300
300
@@ -378,7 +378,7 @@ Putting it all together:
378
378
await echo_client.send_all(test_byte)
379
379
assert await echo_client.receive_some(1) == test_byte
380
380
381
- Now, this works – but there's still a lot of boilerplate. Remember, we
381
+ Now, this works - but there's still a lot of boilerplate. Remember, we
382
382
need to write lots of tests for this server, and we don't want to have
383
383
to copy-paste all that stuff into every test. Let's factor out the
384
384
setup into a fixture::
0 commit comments