pytest-django
pytest-django copied to clipboard
A fixture which gives access to all databases in tests
trafficstars
Hi,
At my company we have a problem that we have to use mark on every test:
@pytest.mark.django_db(databases="__all__")
def test_something(db):
...
@pytest.mark.django_db(databases="__all__")
def test_other(db):
...
# + a bunch of tests which needs to be marked as well
I'd like to propose a solution:
def setup_db(db, django_db_all_databases):
pass
def test_something(setup_db):
...
def test_other(setup_db):
...
Let me know what you think. If you approve this, I will improve this PR with tests, docs, docstrings and so on. I wanted to know your opinion first.
Thanks!
Hey, can anyone look into this?