Skip to content

Update documentation on how pytest.warns affects DeprecationWarning #9291#10141

Merged
nicoddemus merged 2 commits intopytest-dev:mainfrom
clarityai-eng:doc/9291
Aug 17, 2022
Merged

Update documentation on how pytest.warns affects DeprecationWarning #9291#10141
nicoddemus merged 2 commits intopytest-dev:mainfrom
clarityai-eng:doc/9291

Conversation

@toclarity
Copy link
Copy Markdown
Contributor

closes #9291

Co-authored-by: Dani Sancas lord.sancas@gmail.com

On-behalf-of: @clarityai-eng tech@clarity.ai

Signed-off-by: Tatiana Ovary tatiana.ovary@clarity.ai

Copy link
Copy Markdown
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @toclarity, appreciate it!

Looks great overall, please take a look at my comments. 😁

**Using with** ``pytest.mark.parametrize``

When using :ref:`pytest.mark.parametrize ref` it is possible to parametrize tests
such that some runs raise a warning and others do not.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add an example here to illustrate this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we put a link to Parametrizing conditional raising and point out that it is done in a similar way?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example:

This could be achieved in the same way as with exceptions, see 
:ref:`parametrizing_conditional_raising` for an example.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicoddemus we have added the link. Please let us know if this is acceptable or if a specific example is needed.

toclarity and others added 2 commits August 10, 2022 10:15
Co-authored-by: Dani Sancas <lord.sancas@gmail.com>

On-behalf-of: @clarityai-eng <tech@clarity.ai>

Signed-off-by: Tatiana Ovary <tatiana.ovary@clarity.ai>
Co-authored-by: Dani Sancas <lord.sancas@gmail.com>
Copy link
Copy Markdown
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great addition, thanks a lot!

@nicoddemus nicoddemus merged commit 3039391 into pytest-dev:main Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document that pytest.warns affects default DeprecationWarning processing

2 participants