Skip to content

Fix #1017 - add option remember the last failed set if its not completely resolved - #1128

Closed
RonnyPfannschmidt wants to merge 3 commits into
pytest-dev:featuresfrom
RonnyPfannschmidt:fix-1017
Closed

RonnyPfannschmidt wants to merge 3 commits into
pytest-dev:featuresfrom
RonnyPfannschmidt:fix-1017

Conversation

@RonnyPfannschmidt

Copy link
Copy Markdown
Member

as noted in #1017 when doing a red-green rre-factoring
it is helpful to keep running a larger test set instead of loosing track of those that passed once

@RonnyPfannschmidt RonnyPfannschmidt added this to the 2.9 milestone Oct 11, 2015
@RonnyPfannschmidt RonnyPfannschmidt changed the title [wip] Fix #1017 - add option remember the last failed set if its not completely resolved Fix #1017 - add option remember the last failed set if its not completely resolved Oct 11, 2015
Comment thread doc/en/cache.rst

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.

This text seems confusing to me... perhaps this could be written as:

* ``--lf-keep`` (last full failure set) - will not clear the previous set of failed tests, so a test 
will only be removed from the failed set if it passes. This works particularly well when used in combination 
with ``--ff --lf-keep -x``, so tests can be fixed one at a time.

@nicoddemus

Copy link
Copy Markdown
Member

I have missed this feature in more than one occasion. In fact I would argue that --lf-keep should be enabled by default, so when a test fails it is kept into the "failure set" until it passes. While this is a backward incompatible change, --lf and --lf-keep are meant to be used interactively so no test suites would break. What do you think?

@RonnyPfannschmidt

Copy link
Copy Markdown
Member Author

I'm fine with both, I'd like to hear @hpk42 opinion

@RonnyPfannschmidt RonnyPfannschmidt added type: enhancement new feature or API change, should be merged into features branch plugin: cache related to the cache builtin plugin topic: selection related to test selection from the command line type: backward compatibility might present some backward compatibility issues which should be carefully noted in the changelog labels Oct 25, 2015
@nicoddemus

Copy link
Copy Markdown
Member

Any news on this?

@RonnyPfannschmidt

Copy link
Copy Markdown
Member Author

no, i'd still like holgers input

@hpk42

hpk42 commented Nov 19, 2015

Copy link
Copy Markdown
Contributor

i also think we should just change the default behaviour. Compatibility on that level is not that important as @nicoddemus aleady mentioned.

I often do a full test run, then do "py.test --lf test_some_module.py" and after i got those passing am annoyed that all other failures have been lost already. If one wants to do a re-run it is easy enough to simply not use "--lf" then.

@RonnyPfannschmidt

Copy link
Copy Markdown
Member Author

im on it

@RonnyPfannschmidt

Copy link
Copy Markdown
Member Author

after tacking it on detail i noticed various edge cases that cant be solved soon, will create a new pr in future

@nicoddemus

Copy link
Copy Markdown
Member

OK, thanks @RonnyPfannschmidt !

@RonnyPfannschmidt
RonnyPfannschmidt deleted the fix-1017 branch February 21, 2018 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin: cache related to the cache builtin plugin topic: selection related to test selection from the command line type: backward compatibility might present some backward compatibility issues which should be carefully noted in the changelog 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