telemachus

telemachus

Warnings in Python Testing With Pytest Chapter 2

Python Testing With Pytest - Chapter 2, warnings for “unregistered custom marks”

While running the smoke tests in Chapter 2, I get these warnings:

tests/func/test_add.py:18
  /Users/telemachus/Downloads/pytest-code/ch2/tasks_proj/tests/func/test_add.py:18: PytestUnknownMarkWarning: Unknown pytest.mark.smoke - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
    @pytest.mark.smoke

tests/func/test_api_exceptions.py:13
  /Users/telemachus/Downloads/pytest-code/ch2/tasks_proj/tests/func/test_api_exceptions.py:13: PytestUnknownMarkWarning: Unknown pytest.mark.smoke - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
    @pytest.mark.smoke

tests/func/test_api_exceptions.py:20
  /Users/telemachus/Downloads/pytest-code/ch2/tasks_proj/tests/func/test_api_exceptions.py:20: PytestUnknownMarkWarning: Unknown pytest.mark.get - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
    @pytest.mark.get

tests/func/test_api_exceptions.py:21
  /Users/telemachus/Downloads/pytest-code/ch2/tasks_proj/tests/func/test_api_exceptions.py:21: PytestUnknownMarkWarning: Unknown pytest.mark.smoke - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
    @pytest.mark.smoke

-- Docs: https://docs.pytest.org/en/latest/warnings.html

Happily, pytest has great error messages, and this was pretty easy to fix. I just added information to pytest.ini. But if the book gets an update, you should probably update the code for the latest pytest API. (I’m guessing that you didn’t use to have to register custom marks this way?)

5 2070 1

Popular Prag Prog topics Top

brianokken
Many tasks_proj/tests directories exist in chapters 2, 3, 5 that have tests that use the custom markers smoke and get, which are not decl...
2 1373 2
New
yulkin
your book suggests to use Image.toByteData() to convert image to bytes, however I get the following error: "the getter ‘toByteData’ isn’t...
1 4015 2
New
herminiotorres
Hi! I know not the intentions behind this narrative when called, on page XI: mount() |> handle_event() |> render() but the correc...
3 1296 17
New
adamwoolhether
When trying to generate the protobuf .go file, I receive this error: Unknown flag: --go_opt libprotoc 3.12.3 MacOS 11.3.1 Googling ...
0 4825 3
New
nicoatridge
Hi, I have just acquired Michael Fazio’s “Kotlin and Android Development” to learn about game programming for Android. I have a game in p...
0 7902 6
New
Keton
When running the program in chapter 8, “Implementing Combat”, the printout Health before attack was never printed so I assumed something ...
2 999 2
New
a.zampa
@mfazio23 I’m following the indications of the book and arriver ad chapter 10, but the app cannot be compiled due to an error in the Bas...
1 3307 6
New
ggerico
I got this error when executing the plot files on macOS Ventura 13.0.1 with Python 3.10.8 and matplotlib 3.6.1: programming_ML/code/03_...
1 3019 5
New
bjnord
Hello @herbert ! Trying to get the very first “Hello, Bracket Terminal!" example to run (p. 53). I develop on an Amazon EC2 instance runn...
0 1110 2
New
mcpierce
@mfazio23 I’ve applied the changes from Chapter 5 of the book and everything builds correctly and runs. But, when I try to start a game,...
0 1136 10
New

Other popular topics Top

AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
193 4238 93
New
AstonJ
What chair do you have while working… and why? Is there a ‘best’ type of chair or working position for developers?
74 4630 41
New
malloryerik
Any thoughts on Svelte? Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
54 3308 17
New
AstonJ
You might be thinking we should just ask who’s not using VSCode :joy: however there are some new additions in the space that might give V...
105 4396 51
New
AstonJ
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
87 5706 50
New
PragmaticBookshelf
Author Spotlight Rebecca Skinner @RebeccaSkinner Welcome to our latest author spotlight, where we sit down with Rebecca Skinner, auth...
106 10202 29
New
PragmaticBookshelf
Author Spotlight Erin Dees @undees Welcome to our new author spotlight! We had the pleasure of chatting with Erin Dees, co-author of ...
24 3409 12
New
PragmaticBookshelf
Author Spotlight: Karl Stolley @karlstolley Logic! Rhetoric! Prag! Wow, what a combination. In this spotlight, we sit down with Karl ...
31 3516 17
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
27 2373 10
New
PragmaticBookshelf
Author Spotlight: Sophie DeBenedetto @SophieDeBenedetto The days of the traditional request-response web application are long gone, b...
37 2987 15
New