February 2022
Intermediate to advanced
274 pages
6h 28m
English
We’ve covered a lot in this chapter and are well on our way to testing the Cards application.
The sample code should be downloaded into /path/to/code.
The Cards application (and pytest) is installed into a virtual environment with the following steps:
pytest uses assert rewriting, which allows us to use standard Python assert expressions.
Tests can fail from assertion failures, from calls to fail(), or from any uncaught exception.
pytest.raises() is used to test for expected exceptions.
A great way to structure tests is called Given-When-Then or Arrange-Act-Assert.
Classes can ...
Read now
Unlock full access