Answer the question
In order to leave comments, you need to log in
How to prepare conditions for multiple test suites in Py.test?
There are several test kits:
[test_profile.py]
import pytest
from conftest import *
class TestProfile
def test_name(self):
response = self.query.get('/profile/name', params={'1':'1'})
content = response.json()
print("Server response: " + str(content))
assert response.status_code, 200
def test_surname(self):
response = self.query.post('/profile/surname, data={'key_id': '10'})
assert response.status_code, 200
[conftest.py]
@pytest.fixture(autouse=True, scope='module')
def module_setup_teardown():
print("MODULE SETUP!!!")
yield
print("MODULE TEARDOWN!!!")
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question