Errata

Python Testing with pytest

Errata for Python Testing with pytest

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Ch2/Marking Test Functions
3rd paragraph, 1st line

@mark.pytest.smoke should be @pytest.mark.smoke

Anonymous  Nov 09, 2019 
Ch2/Running a Subset of Tests
ch2/tasks_proj/tests/func/test_api_exceptions.py

typo (2 places, lines 32 & 38): excption

Anonymous  Nov 09, 2019 
Ch3/Tracing Fixture Execution with –setup-show
Section title

In the heading it looks like double-hyphen '--' got converted to an en-dash (?), should be '--setup-show'

Anonymous  Nov 09, 2019 
Ch3/Specifying Fixtures with usefixtures
1st paragraph

This indicates passing fixture names as separate arguments: @pytest.mark.usefixtures(’fixture1’, ’fixture2’). But this suggests it takes a single string argument: usefixtures takes a string that is composed of a comma-separated list of fixtures. It's not clear which is correct (maybe both work?).

Anonymous  Nov 10, 2019 
Ch3/Parametrizing Fixtures
Paragraph after ch3/c/tasks_proj/tests/conftest.py listing

I believe temp_db should be tasks_db_session

Anonymous  Nov 10, 2019 
Ch4/Using tmpdir and tmpdir_factory
Paragraph beginning "The tmpdir_factory fixture is a lot like tmpdir..."

"test scope fixtures" should be "session scope fixtures"

Anonymous  Nov 10, 2019 
Ch4/Using capsys
Paragraph after ch4/cap/test_capsys.py listing

capsys.redouterr() should be capsys.readouterr()

Anonymous  Nov 10, 2019 
Ch4/Using tmpdir and tmpdir_factory
ch4/authors/conftest.py listing

This isn't really a typo in the book, it's a typo in the corresponding source code at https://pragprog.com/titles/bopytest/source_code

The version of this file in the source_code renamed the 'file' variable to 'file_', except that a couple on the last few lines were missed.

Anonymous  Nov 10, 2019 
Printed Page 137
3rd paragraph from the bottom of the page

The text suggests using Python 3.6, whereas the examples on the following pages seem to use Python 3.7.

Artem  Jan 22, 2022