Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate raises(..., 'code(as_a_string)') / warns(..., 'code(as_a_string)'). #4443

Merged
merged 1 commit into from
Nov 29, 2018
Merged

Deprecate raises(..., 'code(as_a_string)') / warns(..., 'code(as_a_string)'). #4443

merged 1 commit into from
Nov 29, 2018

Conversation

asottile
Copy link
Member

@asottile asottile commented Nov 22, 2018

Resolves #4435

TODONE:

  • resolve the CI failures (surely there's some!)
  • write actual tests for the warning
  • regendocs
  • deprecation docs (by @nicoddemus 😁)

@asottile
Copy link
Member Author

urgh and there's a circular import. great.

@@ -325,7 +325,7 @@ def test_gen():
assert len(colitems) == 1
gencol = colitems[0]
assert isinstance(gencol, pytest.Generator)
pytest.raises(ValueError, "gencol.collect()")
pytest.raises(ValueError, gencol.collect)
Copy link
Member

Choose a reason for hiding this comment

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

to highlight the importance of the call visually i'd propose a with statement in that case

Copy link
Member Author

Choose a reason for hiding this comment

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

if it's ok, I'm going to leave these as is so it's a less noisy diff -- we can clean these up in a followup

@codecov
Copy link

codecov bot commented Nov 22, 2018

Codecov Report

Merging #4443 into features will decrease coverage by 53.44%.
The diff coverage is 16.32%.

Impacted file tree graph

@@              Coverage Diff              @@
##           features    #4443       +/-   ##
=============================================
- Coverage     95.87%   42.42%   -53.45%     
=============================================
  Files           111       92       -19     
  Lines         25222    20985     -4237     
  Branches       2474     2365      -109     
=============================================
- Hits          24181     8903    -15278     
- Misses          732    11480    +10748     
- Partials        309      602      +293
Flag Coverage Δ
#docs 29.15% <12.24%> (-0.07%) ⬇️
#doctesting 29.15% <12.24%> (-0.07%) ⬇️
#linting 29.15% <12.24%> (-0.07%) ⬇️
#linux 42.42% <16.32%> (-53.29%) ⬇️
#nobyte ?
#numpy 40.81% <16.32%> (-52.56%) ⬇️
#pexpect 40.81% <16.32%> (-0.95%) ⬇️
#py27 40.81% <16.32%> (-53.14%) ⬇️
#py34 ?
#py35 ?
#py36 ?
#py37 ?
#trial 40.81% <16.32%> (-52.56%) ⬇️
#windows ?
#xdist ?
Impacted Files Coverage Δ
testing/test_session.py 0% <0%> (-96.53%) ⬇️
testing/test_config.py 0% <0%> (-99.43%) ⬇️
testing/test_monkeypatch.py 0% <0%> (-99.62%) ⬇️
testing/test_recwarn.py 0% <0%> (-99.57%) ⬇️
testing/test_capture.py 0% <0%> (-99.24%) ⬇️
testing/test_pytester.py 0% <0%> (-87.46%) ⬇️
testing/test_runner.py 0% <0%> (-96.92%) ⬇️
testing/test_pluginmanager.py 0% <0%> (-99.59%) ⬇️
testing/test_parseopt.py 0% <0%> (-94.7%) ⬇️
src/_pytest/deprecated.py 100% <100%> (ø) ⬆️
... and 96 more

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 5cf69fa...1bba0a9. Read the comment docs.

Copy link
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.

Nice, we just need to give the docs some love! 😁

src/_pytest/python_api.py Show resolved Hide resolved
src/_pytest/python_api.py Show resolved Hide resolved
doc/en/assert.rst Show resolved Hide resolved
changelog/4435.deprecation.rst Outdated Show resolved Hide resolved
@asottile
Copy link
Member Author

I ran regendoc but decided against committing it since it twiddled all the python / python3.6 things, and broke for the new dataclasses assert. I'll make some (internal) tickets about this

@asottile asottile changed the title [WIP] Deprecate raises(..., 'code(as_a_string'). Deprecate raises(..., 'code(as_a_string)') / warns(..., 'code(as_a_string)'). Nov 29, 2018
@asottile
Copy link
Member Author

@nicoddemus @RonnyPfannschmidt -- ready for another round of review :)

@nicoddemus
Copy link
Member

Thanks @asottile! We just need to sort out the failure before we merge it. 👍

@asottile
Copy link
Member Author

lol of course -- the test I just added 😆

@asottile asottile merged commit 1d86247 into pytest-dev:features Nov 29, 2018
@asottile asottile deleted the deprecate_raises_exec branch November 29, 2018 19:58
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.

3 participants