Skip to content

Commit

Permalink
Make use of async comprehensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed May 16, 2020
1 parent e024953 commit 1948be5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/starwars/test_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ async def test_subscription_support_using_client():
params = {"ep": "JEDI"}
expected = [{**review, "episode": "JEDI"} for review in reviews[6]]

results = []

async with Client(schema=StarWarsSchema) as session:
async for result in session.subscribe(subs, variable_values=params):
results.append(result["reviewAdded"])
results = [
result["reviewAdded"]
async for result in session.subscribe(subs, variable_values=params)
]

assert results == expected

0 comments on commit 1948be5

Please sign in to comment.