We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello there, When I run my tests I got the following warning
../../usr/local/lib/python3.11/site-packages/_pytest/config/init.py:747 /usr/local/lib/python3.11/site-packages/_pytest/config/init.py:747: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: products.tests.factories self.import_plugin(import_spec)
This happens because I have one file of fixtures
@register class ProductCycleFactory(factory.django.DjangoModelFactory): class Meta: model = ProductCycle product = factory.SubFactory(ProductFactory) cycle_id = factory.Faker("numerify", text="#" * 9) vat_id = factory.Faker("numerify", text="#" * 9)
And in my other file of fixtures i have
from products.tests.factories import ProductCycleFactory @register class InvoiceLineFactory(factory.django.DjangoModelFactory): class Meta: model = InvoiceLine description = factory.Faker("sentence", nb_words=3) invoice = factory.SubFactory(InvoiceFactory) product_cycle = factory.SubFactory(ProductCycleFactory)
I already try to change to product_cycle = factory.SubFactory("products.tests.factories.ProductCycleFactory")
product_cycle = factory.SubFactory("products.tests.factories.ProductCycleFactory")
My requirements
pytest==7.2.0 pytest-django==4.5.2 pytest-factoryboy==2.5.1
Any idea how I solve this warning, Thanks
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello there,
When I run my tests I got the following warning
../../usr/local/lib/python3.11/site-packages/_pytest/config/init.py:747
/usr/local/lib/python3.11/site-packages/_pytest/config/init.py:747: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: products.tests.factories
self.import_plugin(import_spec)
This happens because I have one file of fixtures
And in my other file of fixtures i have
I already try to change to
product_cycle = factory.SubFactory("products.tests.factories.ProductCycleFactory")
My requirements
Any idea how I solve this warning,
Thanks
The text was updated successfully, but these errors were encountered: