You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If it's put in the root conftest.py, then I don't to need the import, but can use baker a regular fixture. For example:
@pytest.mark.django_dbdeftest_domain_str(baker): # <- in place of the model_bakery.baker import# Arrange.domain=baker.make(
"evaluation.Domain",
name="natural sciences",
)
# Act.domain_str=str(domain)
# Assert.assertdomain_str=="natural sciences"
What would you say to extend the model_bakery (or develop a separate project for a plugin) by such a fixture?
Alternatively, one could develop this idea as a separate plugin for Pytest.
The text was updated successfully, but these errors were encountered:
This is a discussion/question kind of issue.
I have recently worked with a test suite (run with Pytest) in which basically each module uses the import:
I realised that
baker
module is actually a good (?) candidate for a fixture, so I wrote a simple wrapper like:If it's put in the root
conftest.py
, then I don't to need the import, but can usebaker
a regular fixture. For example:What would you say to extend the
model_bakery
(or develop a separate project for a plugin) by such a fixture?Alternatively, one could develop this idea as a separate plugin for Pytest.
The text was updated successfully, but these errors were encountered: