Meliowant

Meliowant

Python Testing with pytest, Second Edition: example with complex -k argument contains tests not mentioned previously (page 28)

There is the following example, on the page 28:

$ pytest -v --tb=no -k “(dict or ids) and not TestEquality”
=========================== test session starts ===========================
collected 24 items / 18 deselected / 6 selected
test_card.py::test_equality_with_diff_ids PASSED [ 16%]
test_card.py::test_from_dict PASSED [ 33%]
test_card.py::test_to_dict PASSED [ 50%]
test_classes.py::test_from_dict PASSED [ 66%]
test_classes.py::test_to_dict PASSED [ 83%]
test_structure.py::test_to_dict PASSED [100%]
==================== 6 passed, 18 deselected in 0.08s ====================

But tests test_from_dict() and test_to_dict() are missing (or at least were not mentioned) in the test_classes.py before that page. And this confuses.

I see that tests are in the source code that accompanies the book, so maybe these tests will be added to the test_classes.py later, but at the page 28 they don’t exist in the file.

Thus the example should be something like:

$ pytest -v --tb=no -k “(ids or dict) and not TestEqual”
============================ test session starts =============================
collected 19 items / 15 deselected / 4 selected
test_card.py::test_equality_with_diff_ids PASSED [ 25%]
test_card.py::test_from_dict PASSED [ 50%]
test_card.py::test_to_dict PASSED [ 75%]
test_structure.py::test_to_dict PASSED [100%]
====================== 4 passed, 15 deselected in 0.18s ======================

Popular Prag Prog topics Top

New
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...
New
jamis
The following is cross-posted from the original Ray Tracer Challenge forum, from a post by garfieldnate. I’m cross-posting it so that the...
New
sdmoralesma
Title: Web Development with Clojure, Third Edition - migrations/create not working: p159 When I execute the command: user=> (create-...
New
jdufour
Hello! On page xix of the preface, it says there is a community forum "… for help if your’re stuck on one of the exercises in this book… ...
New
New
curtosis
Running mix deps.get in the sensor_hub directory fails with the following error: ** (Mix) No SSH public keys found in ~/.ssh. An ssh aut...
New
s2k
Hi all, currently I wonder how the Tailwind colours work (or don’t work). For example, in app/views/layouts/application.html.erb I have...
New
Keton
When running the program in chapter 8, “Implementing Combat”, the printout Health before attack was never printed so I assumed something ...
New
SlowburnAZ
Getting an error when installing the dependencies at the start of this chapter: could not compile dependency :exla, "mix compile" failed...
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
AstonJ
There’s a whole world of custom keycaps out there that I didn’t know existed! Check out all of our Keycaps threads here: https://forum....
New
Exadra37
I am a Linux user since 2012, more or less, and I always use Ubuntu on my computers, and my last 2 laptops have been used Thinkpads, wher...
New
AstonJ
Inspired by this post from @Carter, which languages, frameworks or other tech or tools do you think is killing it right now? :upside_down...
New
Rainer
Not sure if following fits exactly this thread, or if we should have a hobby thread… For many years I’m designing and building model air...
New
PragmaticBookshelf
A Hero’s Journey with Chris Pine @chrispine Chris Pine, author of Learn to Program, Third Edition, discusses his journey to beco...
New
rustkas
Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
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...
New
New