From the course: Unit Testing in Django
Unlock the full course today
Join today to access over 25,200 courses taught by industry experts.
Getting familiar with pytest output - Django Tutorial
From the course: Unit Testing in Django
Getting familiar with pytest output
- [Leticia] Although pytest output looks amazing when all the tests are passing, in the vast majority of cases, we'll spend much more time in its error screens. Now that we've seen how pytest works, let's create a second test that actually fails. Let's call it test_failing. And let's assert that 1 is equal equals 2. We can run pytest again. And okay, we have a test failing. Great. Let's take a closer look. So first we can see here that although we run 100% of the test file, we have two tests. One that's passing, that's represented by this green dot, and one that's failing, represented by the F in red. We can also see here the FAILURES. So the test that was failing is the test_failing. And the point that it failed was in the assertion. We can see here as well that there is a summary info where the test_failing in the home/tests of py is failing on the assertion 1 is equal to 2. You may be thinking that this is way…