pytest-django icon indicating copy to clipboard operation
pytest-django copied to clipboard

Add docstrings to public fixtures

Open kosdmit opened this issue 7 months ago • 0 comments

This PR adds short docstrings to quickly check available fixtures and is especially usefull for new pytest-django users.

I've noticed that some public fixtures don't have docstrings to give the ability to quickly check what this fixture does. For example, the command pytest --fixtures shows builtin and custom fixtures with their short descriptions, but pytest-django doesn't provide them all:

...
-------------------------------------------------------------- fixtures defined from pytest_django.plugin --------------------------------------------------------------- 
django_test_environment [session scope] -- pytest_django\plugin.py:479
    Setup Django's test environment for the testing session.

django_db_blocker [session scope] -- pytest_django\plugin.py:507
    Wrapper around Django's database access.

mailoutbox -- pytest_django\plugin.py:577
    no docstring available

django_mail_patch_dns -- pytest_django\plugin.py:590
    no docstring available

django_mail_dnsname -- pytest_django\plugin.py:600
    no docstring available
...

After docstrings update:

pytest --fixtures
...
-------------------------------------------------------------- fixtures defined from pytest_django.plugin --------------------------------------------------------------- 
django_test_environment [session scope] -- pytest_django\plugin.py:479
    Setup Django's test environment for the testing session.

django_db_blocker [session scope] -- pytest_django\plugin.py:507
    Wrapper around Django's database access.

mailoutbox -- pytest_django\plugin.py:577
    A clean email outbox to which Django-generated emails are sent.

django_mail_patch_dns -- pytest_django\plugin.py:591
    Patch the server dns name used in email messages.

django_mail_dnsname -- pytest_django\plugin.py:602
    Return server dns name for using in email messages.
...

kosdmit avatar Jul 29 '24 20:07 kosdmit