# Python Testing with pytest: pytest now requires markers to be declared (downloadable code)

**URL:** <https://forum.devtalk.com/t/python-testing-with-pytest-pytest-now-requires-markers-to-be-declared-downloadable-code/1253>\
**Category:** PragProg Customers\
**Tags:** book-python-testing-with-pytest, errata\
**Created:** [3 August 2020 17:23 UTC](https://forum.devtalk.com/t/python-testing-with-pytest-pytest-now-requires-markers-to-be-declared-downloadable-code/1253 "2020-08-03T17:23:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![brianokken](https://forum.devtalk.com/user_avatar/forum.devtalk.com/brianokken/32/846_2.png) [@brianokken](https://forum.devtalk.com/u/brianokken)\
**Post date:** [3 August 2020 17:23 UTC](https://forum.devtalk.com/t/python-testing-with-pytest-pytest-now-requires-markers-to-be-declared-downloadable-code/1253/1 "2020-08-03T17:23:57Z")

</div>

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 declared in a `pytest.ini` file. This was allowed when the book was published. But recent versions of pytest will issue a warning with undeclared markers.

To fix the warning, add this small `pytest.ini` file to any `tests` directory that’s causing a problem:

```auto
[pytest]
markers =
    smoke
    get

```

---

<div class="post-metadata">

**Author:** ![Zhen](https://forum.devtalk.com/letter_avatar_proxy/v4/letter/z/a88e57/32.png) [@Zhen](https://forum.devtalk.com/u/Zhen)\
**Post date:** [11 February 2021 14:39 UTC](https://forum.devtalk.com/t/python-testing-with-pytest-pytest-now-requires-markers-to-be-declared-downloadable-code/1253/2 "2021-02-11T14:39:15Z")

</div>

Hi there,  
still not working with your update.  
is it possible to update all the codes and upload to Github ?

thanks,

---

<div class="post-metadata">

**Author:** ![drulum](https://forum.devtalk.com/user_avatar/forum.devtalk.com/drulum/32/2480_2.png) [@drulum](https://forum.devtalk.com/u/drulum)\
**Post date:** [16 February 2021 13:21 UTC](https://forum.devtalk.com/t/python-testing-with-pytest-pytest-now-requires-markers-to-be-declared-downloadable-code/1253/3 "2021-02-16T13:21:09Z")

</div>

pytest.ini is in the source code zip file available on the pragprog website, but it seems to be in the wrong directory.

I found it as “ch2/tasks\_prog/tests/pytest.ini” and on moving it up one level to “ch2/tasks\_prog/pytest.ini” it suddenly works, regardless which directory I’m in when I run pytest.

I haven’t checked other chapter directories yet, but worth having a look at that.
