pytest-repeat icon indicating copy to clipboard operation
pytest-repeat copied to clipboard

Adding Support for UnitTest Style Tests

Open Anjiang-Wei opened this issue 4 years ago • 7 comments

I find the plugin pytest-flakefinder (https://github.com/dropbox/pytest-flakefinder), which seems to support UnitTest Style Tests already. You may want to refer to this file: https://github.com/dropbox/pytest-flakefinder/blob/master/tests/test_flakefinder.py Do you think it helpful for pytest-repeat?

Anjiang-Wei avatar Jul 30 '21 15:07 Anjiang-Wei

It appears that the tests augmented with pytest-flakefinder plugin do not repeat in a function mode. For example, if setting scope=function mode for pytest-repeat, test1's repeat should be: test1, test1 (consecutively). However, it appears to me that it does not seem to be the case in pytest-flakefinder.

Anjiang-Wei avatar Jul 30 '21 15:07 Anjiang-Wei

Unittest tests do not supported fixture parameterization, this won't change

RonnyPfannschmidt avatar Jul 31 '21 06:07 RonnyPfannschmidt

@RonnyPfannschmidt Would this be reasonable to document, and then close, as it's not fixable?

okken avatar Oct 05 '23 19:10 okken

This ought to be documented as limitation imposed by the core unittesting plugin which doesn't support parameterization

RonnyPfannschmidt avatar Oct 05 '23 19:10 RonnyPfannschmidt

Ah. It's already documented I'm thinking a longer "Limitations" section in the README might be cool to cover this and any other items, like #21, but for now, this is already documented. This is in the README, but it's not obvious.

okken avatar Oct 05 '23 19:10 okken

@RonnyPfannschmidt Thanks for your thoughts on these issues.

okken avatar Oct 05 '23 19:10 okken

If it's too easy to miss, maybe there is a way to make the reader stumble More to The point

RonnyPfannschmidt avatar Oct 05 '23 19:10 RonnyPfannschmidt