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

Additionally handle logstart and logfinish hooks #3189

Merged

Conversation

@s0undt3ch
Copy link
Contributor

@s0undt3ch s0undt3ch commented Feb 5, 2018

Thanks for submitting a PR, your contribution is really appreciated!

Here's a quick checklist that should be present in PRs:

  • Add a new news fragment into the changelog folder
    • name it $issue_id.$type for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of removal, feature, bugfix, vendor, doc or trivial
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."
  • Target: for bugfix, vendor, doc or trivial fixes, target master; for removals or features target features;
  • Make sure to include reasonable tests for your change if necessary

Unless your change is a trivial or a documentation fix (e.g., a typo or reword of a small section) please:

  • Add yourself to AUTHORS, in alphabetical order;
@s0undt3ch s0undt3ch force-pushed the s0undt3ch:feature/logstart-logfinish branch from e98ae1f to 4eccf4d Feb 5, 2018
@s0undt3ch s0undt3ch mentioned this pull request Feb 5, 2018
3 of 4 tasks complete
@s0undt3ch s0undt3ch force-pushed the s0undt3ch:feature/logstart-logfinish branch from 4eccf4d to 23c15f9 Feb 5, 2018
@coveralls
Copy link

@coveralls coveralls commented Feb 5, 2018

Coverage Status

Coverage increased (+0.006%) to 92.634% when pulling ea06c13 on s0undt3ch:feature/logstart-logfinish into f2fb841 on pytest-dev:features.

Copy link
Member

@nicoddemus nicoddemus left a comment

Great work @s0undt3ch, thanks!

@@ -371,18 +371,20 @@ def _runtest_for(self, item, when):
formatter=self.formatter, level=self.log_level) as log_handler:
if self.log_cli_handler:
self.log_cli_handler.set_when(when)

This comment has been minimized.

@thisch

thisch Feb 5, 2018
Contributor

I would add the following code here and remove your if item checks:

if item is None:
    yield
    return

This comment has been minimized.

@s0undt3ch

s0undt3ch Feb 5, 2018
Author Contributor

Good point.

@thisch
Copy link
Contributor

@thisch thisch commented Feb 5, 2018

Thx for working on this!

@s0undt3ch s0undt3ch force-pushed the s0undt3ch:feature/logstart-logfinish branch from a2369c3 to c9123c6 Feb 6, 2018
@s0undt3ch
Copy link
Contributor Author

@s0undt3ch s0undt3ch commented Feb 6, 2018

@nicoddemus sorry, I force pushed the changes asked by @thisch and lost your change log changes(forgot to pull first).

@nicoddemus
Copy link
Member

@nicoddemus nicoddemus commented Feb 6, 2018

I force pushed the changes asked by @thisch and lost your change log changes(forgot to pull first).

No worries, just pushed my change again. 👍

@s0undt3ch
Copy link
Contributor Author

@s0undt3ch s0undt3ch commented Feb 6, 2018

Thanks!

@s0undt3ch s0undt3ch force-pushed the s0undt3ch:feature/logstart-logfinish branch from 8abc7a4 to a8ac48c Feb 6, 2018
if not hasattr(item, 'catch_log_handlers'):
item.catch_log_handlers = {}

This comment has been minimized.

@thisch

thisch Feb 6, 2018
Contributor

This newline and the next one are not really needed. Can you remove them please?

This comment has been minimized.

@s0undt3ch

s0undt3ch Feb 6, 2018
Author Contributor

Done

This comment has been minimized.

@thisch

thisch Feb 6, 2018
Contributor

Thx

@s0undt3ch s0undt3ch force-pushed the s0undt3ch:feature/logstart-logfinish branch from a8ac48c to ea06c13 Feb 6, 2018
@thisch
thisch approved these changes Feb 6, 2018
@nicoddemus nicoddemus merged commit ed12cf3 into pytest-dev:features Feb 7, 2018
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants