Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Last active June 9, 2021 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/0a2a50136fbecb8bd8bfe67b01e4b376 to your computer and use it in GitHub Desktop.
Save velotiotech/0a2a50136fbecb8bd8bfe67b01e4b376 to your computer and use it in GitHub Desktop.
$ pytest
============================= test session starts ==============================
platform linux -- Python 3.7.0, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
django: settings: pytest_fixtures.settings (from ini)
rootdir: /home/suraj/PycharmProjects/e_commerce_app, configfile: pytest.ini
plugins: django-4.1.0
collected 2 items
product/tests/test_models.py EE [100%]
==================================== ERRORS ====================================
___________________ ERROR at setup of test_product_retailer ____________________
ScopeMismatch: You tried to access the 'function' scoped fixture 'db' with a 'module' scoped request object, involved factories
product/tests/test_models.py:13: def retailer_abc(db) -> product.models.Category
venv/lib/python3.7/site-packages/pytest_django/fixtures.py:193: def db(request, django_db_setup, django_db_blocker)
______________________ ERROR at setup of test_product_one ______________________
ScopeMismatch: You tried to access the 'function' scoped fixture 'db' with a 'module' scoped request object, involved factories
...
============================== 2 errors in 0.24s =============================== [100%]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment