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

WIP: save data with --xfail / -x #47

Merged
merged 3 commits into from Sep 18, 2016

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Aug 24, 2016

When using -x to abort the test run on the first failure,
pytest-testmon would previously not store the collected data: the
pytest_keyboard_interrupt hook that is used for this gets also called
for pytest's internal Interrupted exception, which is a subclass of
KeyboardInterrupt (pytest-dev/pytest#1865).

This patch changes it to use the result in the pytest_runtest_protocol
method to check for KeyboardInterrupt there explicitly.

This makes the pytest_keyboard_interrupt obsolete, but I've left it
with some asserts for now.

When using `-x` to abort the test run on the first failure,
pytest-testmon would previously not store the collected data: the
`pytest_keyboard_interrupt` hook that is used for this gets also called
for pytest's internal `Interrupted` exception, which is a subclass of
`KeyboardInterrupt` (pytest-dev/pytest#1865).

This patch changes it to use the result in the `pytest_runtest_protocol`
method to check for `KeyboardInterrupt` there explicitly.

This makes the `pytest_keyboard_interrupt` obsolete, but I've left it
with some asserts for now.
Also handle pytest-watch sending SIGINT.
@tarpas tarpas merged commit b704695 into tarpas:master Sep 18, 2016
@blueyed blueyed deleted the save-data-with-maxfail branch September 18, 2016 20:23
@blueyed
Copy link
Contributor Author

blueyed commented Sep 18, 2016

Thanks for merging - should have been squashed though.
Check out https://coderwall.com/p/hh-4ea/git-rebase-autosquash and http://fle.github.io/git-tip-keep-your-branch-clean-with-fixup-and-autosquash.html.

With GitHub just use the squash-merge option from the UI if it should be one commit (like in this case).

tarpas added a commit that referenced this pull request Dec 17, 2016
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.

None yet

2 participants