Skip to content

Commit 2716593

Browse files
committed
Fix example
1 parent 82c930f commit 2716593

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

README.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,20 +368,24 @@ A common use case is when we have to assert the outcome of an HTTP request:
368368
369369
from pytest_bdd import scenarios, given, when, then
370370
371+
from my_app.models import Article
372+
371373
scenarios("blog.feature")
372374
375+
373376
@given("there is an article", target_fixture="article")
374377
def there_is_an_article():
375378
return Article()
376379
380+
377381
@when("I request the deletion of the article", target_fixture="request_result")
378-
def there_should_be_a_new_article(article, http_client): # <-- Important bit here
382+
def there_should_be_a_new_article(article, http_client):
379383
return http_client.delete(f"/articles/{article.uid}")
380384
385+
381386
@then("the request should be successful")
382387
def article_is_published(request_result):
383-
assert request_result.status_code = 200
384-
388+
assert request_result.status_code == 200
385389
386390
387391
.. code-block:: gherkin

0 commit comments

Comments
 (0)