Answer the question
In order to leave comments, you need to log in
Why doesn't setup_class work in pytest?
Started learning pytest-django and ran into the following problem. I have class:
@pytest.mark.django_db
class TestNews:
###############
#### Setup ####
###############
def setup_class(cls):
print("!!! In setup class !!!")
cls.COUNT = 50
NewsFactory.create_batch(is_allowed=True, size=cls.COUNT)
Answer the question
In order to leave comments, you need to log in
Most likely, the methods that need to be overridden are named like this:
setUpClass
tearDownClass
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question