Skip to content

Improve pytest.raises 'message' deprecation docs#4678

Merged
asottile merged 1 commit into
pytest-dev:masterfrom
nicoddemus:raises-docs
Jan 27, 2019
Merged

Improve pytest.raises 'message' deprecation docs#4678
asottile merged 1 commit into
pytest-dev:masterfrom
nicoddemus:raises-docs

Conversation

@nicoddemus

Copy link
Copy Markdown
Member

Based on recent discussions in #3974

Comment thread doc/en/deprecations.rst
.. code-block:: python

with pytest.raises(TimeoutError, message="Client got unexpected message"):
wait_for(websocket.recv(), 0.5)

@nicoddemus nicoddemus Jan 24, 2019

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Why didn't I use the asyncio example from #3974?

Blacken docs doesn't seem to like it:

hookid: blacken-docs

doc/en/deprecations.rst:37: code block parse error Cannot parse: 2:10:     await asyncio.wait_for(websocket.recv(), 0.5)
doc/en/deprecations.rst:45: code block parse error Cannot parse: 2:10:     await asyncio.wait_for(websocket.recv(), 0.5)

🤔

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.

await can't exist outside of an async def -- so black rejects the code snippet

@codecov

codecov Bot commented Jan 26, 2019

Copy link
Copy Markdown

Codecov Report

Merging #4678 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4678      +/-   ##
==========================================
- Coverage   95.71%   95.69%   -0.03%     
==========================================
  Files         113      113              
  Lines       24902    24902              
  Branches     2459     2459              
==========================================
- Hits        23835    23829       -6     
- Misses        755      758       +3     
- Partials      312      315       +3
Flag Coverage Δ
#docs 29.57% <ø> (+0.07%) ⬆️
#doctesting 29.57% <ø> (+0.07%) ⬆️
#linting 29.57% <ø> (+0.07%) ⬆️
#linux 95.52% <ø> (-0.03%) ⬇️
#nobyte 92.31% <ø> (ø) ⬆️
#numpy 93.11% <ø> (-0.01%) ⬇️
#pexpect 41.24% <ø> (-0.85%) ⬇️
#py27 92.68% <ø> (-1.04%) ⬇️
#py34 91.82% <ø> (+0.06%) ⬆️
#py35 91.84% <ø> (+0.06%) ⬆️
#py36 91.87% <ø> (+0.06%) ⬆️
#py37 93.85% <ø> (+0.02%) ⬆️
#trial 93.11% <ø> (-0.01%) ⬇️
#windows 93.9% <ø> (ø) ⬆️
#xdist 93.74% <ø> (+0.03%) ⬆️
Impacted Files Coverage Δ
src/_pytest/cacheprovider.py 95.75% <0%> (-1.42%) ⬇️
src/_pytest/unittest.py 93.14% <0%> (-1.15%) ⬇️
testing/test_pdb.py 98.78% <0%> (-0.25%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ddfc04...067f2c6. Read the comment docs.

@asottile asottile merged commit 16f8cda into pytest-dev:master Jan 27, 2019
@nicoddemus nicoddemus deleted the raises-docs branch January 27, 2019 03:05
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.

2 participants