box / flaky

Plugin for nose or pytest that automatically reruns flaky tests.
Apache License 2.0
381 stars 59 forks source link

Do not print report if there were no tests marked as 'flaky' (#116) #150

Closed yeputons closed 5 years ago

yeputons commented 5 years ago

This fixes #116 . In particular, if there are tests marked flaky, but they are deselected by pytest (e.g. with -k flag), then no report will be printed as well. In particular, that removes any extra output when running pytest on tests which do not use flaky, but flaky is installed.

I think that this change may use some end-to-end automatic tests, but I'm not sure where or how to add them. Any suggestions?

I've tested it locally, though: created a virtualenv with pytest, ran setup.py install and checked that the following file prints report when py.test without parameters and does not print report when run with -k test_foo:

from flaky import flaky

def test_foo():
    assert 2 == 3

@flaky
def test_bar():
    assert 2 == 3
boxcla commented 5 years ago

Verified that @yeputons has signed the CLA. Thanks for the pull request!

guoquan commented 5 years ago

The PR is pending and out-of-date. Anyone want to update this and merge it? @boxcla

yeputons commented 5 years ago

@guoquan As there were no code changes between March 3 and today, I've just rebased my change onto the latest commit. There were some README/MANIFEST changes, which I believe to not affect this patch at all.

guoquan commented 5 years ago

I am not with box. @yeputons I reviewed you commit and it looks great. Just hope @boxcla would merge the PR soon.

guoquan commented 5 years ago

@yeputons @Jeff-Meadows Thanks!

Cheers!