Skip to content
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

Proposal: use pytest for running tests #1833

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Proposal: use pytest for running tests #1833

wants to merge 1 commit into from

Conversation

alastair
Copy link
Member

I now use pytest in almost all of my projects, including the django ones. This isn't an absolutely necessary change, but there are some things that I like about pytest:

  • The syntax for running just one file or one test is a bit easier to remember
  • It reports failures a bit more clearly
  • you can use basic assert x == y instead of needing to use self.assertEqual(x, y) (nice to have but not a strong requirement)
  • you don't need to write tests as a class, you can use any function (nice to have but not a strong requirement)
  • Fixtures are a nice way of having reusable functions
  • Markers are pretty cool

Because the configuration for the settings file is now in pyproject.toml, to run tests you just need to

pytest

Anyway, this is a proposal to see if we think that it's useful. If so, we can also update the github actions to use it and change the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant