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

Pass exitstatus to pytest_terminal_summary hook #1809

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Aug 14, 2016

This is useful to know if a testrun has been interrupted
(EXIT_INTERRUPTED).

  • Add a new entry to CHANGELOG.rst

@blueyed blueyed added the type: enhancement new feature or API change, should be merged into features branch label Aug 14, 2016
blueyed added a commit to blueyed/pytest-notifier that referenced this pull request Aug 14, 2016
This uses a instance to store the exitstatus from
`pytest_sessionfinish`, although that could probably just also be done on the
module?!

With `exitstatus` as an argument to the `pytest_terminal_summary` hook
it would be easier (pytest-dev/pytest#1809).
@blueyed
Copy link
Contributor Author

blueyed commented Aug 14, 2016

I came up with it for ratson/pytest-notifier#3.

But then I wonder if it could be just stored on the module level from the pytest_sessionfinish hook - instead of wrapping the plugin into a class instance?

This is useful to know if a testrun has been interrupted
(EXIT_INTERRUPTED).
@blueyed blueyed force-pushed the exitstatus-with-pytest_terminal_summary branch from 13f0b34 to 5b95ee3 Compare August 14, 2016 20:06
@blueyed
Copy link
Contributor Author

blueyed commented Aug 14, 2016

@coveralls
Copy link

Coverage Status

Coverage remained the same at 93.103% when pulling 5b95ee3 on blueyed:exitstatus-with-pytest_terminal_summary into 99a4a1a on pytest-dev:features.

@nicoddemus nicoddemus merged commit d3b8551 into pytest-dev:features Aug 15, 2016
@nicoddemus
Copy link
Member

Thanks @blueyed! 👍

@blueyed
Copy link
Contributor Author

blueyed commented Aug 15, 2016

@nicoddemus
Any feedback on my questions? (especially if it's really necessary)
And the open TODO item about the changelog entry? (Shouldn't it be added there?)

@blueyed blueyed deleted the exitstatus-with-pytest_terminal_summary branch August 15, 2016 22:11
nicoddemus added a commit that referenced this pull request Aug 15, 2016
@nicoddemus
Copy link
Member

Any feedback on my questions? (especially if it's really necessary)

Sorry I missed them!

But then I wonder if it could be just stored on the module level from the pytest_sessionfinish hook - instead of wrapping the plugin into a class instance?

Not sure what do you mean here, care to elaborate?

And the open TODO item about the changelog entry? (Shouldn't it be added there?)

I did it myself in 4971525. 😁

@blueyed
Copy link
Contributor Author

blueyed commented Aug 15, 2016

What I did in ratson/pytest-notifier#3 works already.
(And it might not be necessary to wrap it into a plugin instance)

So just getting the exitstatus in the pytest_sessionfinish hook, storing it on the module and then using it from there in the pytest_terminal_summary should work and might be even the way to go?!

@blueyed
Copy link
Contributor Author

blueyed commented Aug 15, 2016

Anyway, I still think it's fine to have it a bit easier and since it's merged already: 🎆

@nicoddemus
Copy link
Member

Anyway, I still think it's fine to have it a bit easier and since it's merged already

I agree! 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement new feature or API change, should be merged into features branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants