-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
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
Add tests #78
Comments
Sure but wont it better to use Django test |
Yes good point. I have used both Django tests (based on unittest) as well as PyTest (with the pytest-django plugin) to add tests to Django projects. My experience with PyTest is much better, not only in Django project, but also in all kinds of Python projects. I think there are several reasons for that, for instance pytest makes organising tests much simpler and much flexible than unittest. It also make parameterising tests much simpler. It also more economic in terms of lines of code, and in case you already have tests written for unittest, pytest can still run them... Here are two articles with some pros. of using pytest for testing Django: I also want to refer you to this stackoverflow Q/A: |
Ok your call.
…On Sun, 24 Dec 2023, 18:11 Oussama Jarrousse, ***@***.***> wrote:
Yes good point.
I have used both Django tests (based on unittest) as well as PyTest (with
the pytest-django plugin) to add tests to Django projects.
My experience with PyTest is much better, not only in Django project, but
also in all kinds of Python projects.
I think there are several reasons for that, for instance pytest makes
organising tests much simpler and much flexible than unittest. It also make
parameterising tests much simpler. It also more economic in terms of lines
of code, and in case you already have tests written for unittest, pytest
can still run them...
Here are two articles with some pros. of using pytest for testing Django:
https://djangostars.com/blog/django-pytest-testing/
https://jmr.pl/blog/pytest
I also want to refer you to this stackoverflow Q/A:
https://stackoverflow.com/questions/44558018/django-test-vs-pytest (note
that the issue the author mentions with gitlab-ci.yaml is rather lack of
experience of the author with pytest than a real issue... basically he does
not know about tox or hatch)
—
Reply to this email directly, view it on GitHub
<#78 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACPOPRAMRKUTEFT7SPRSPTTYLBH37AVCNFSM6AAAAABBAZVROOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRYGU2TAMRQGY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I've created a pull request #79 that addresses this issue! |
I suggest adding tests with PyTest.
If you like the idea, and you approves I will volunteer to create the boilerplate and the first few tests.
The text was updated successfully, but these errors were encountered: