Advertisement
mailakallistov

Untitled

Jan 19th, 2021
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. import pytest
  2.  
  3.  
  4. @pytest.fixture
  5. def my_fixture(some_other_fixture_which_provides_connection):
  6.     response = some_other_fixture_which_provides_connection.some_endpoint()
  7.     return generator(response.body)
  8.  
  9.  
  10. def generator(response_body):
  11.     for value in response_body:
  12.         yield value
  13.        
  14.  
  15. @pytest.mark.parametrize('response_value', my_fixture)
  16. def test_response(response_value):
  17.     assert response_value.is_OK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement