fix pytest-cov instructions and running test suite multiple times
ClosedPublic

Authored by kparal on Mar 10 2016, 1:45 PM.

Details

Summary

Coverage instructions were not correctly using long option names (equal
sign needed). Also functest_logger.py could not have been run multiple
times in a row, because mem_handler was not erased. Bump pytest and
pytest-cov deps to avoid yet another weird error in pytest when
running test suite multiple times.

This fixes T737.

Test Plan

try

py.test -F testing/ testing/

before and after this patch. Now it should pass OK.
Then test

py.test --functional --cov-report term-missing --cov libtaskotron testing/
py.test --functional --cov-report=term-missing --cov=libtaskotron testing/

The first one should run the test suite twice, the second one only once.

Be sure to update your virtualenv from requirements.txt when trying the patched version.

Diff Detail

Repository
rLTRN libtaskotron
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kparal retitled this revision from to fix pytest-cov instructions and running test suite multiple times.Mar 10 2016, 1:45 PM
kparal updated this object.
kparal edited the test plan for this revision. (Show Details)
kparal added a reviewer: libtaskotron.
mkrizek accepted this revision.Mar 10 2016, 1:52 PM
mkrizek added a reviewer: mkrizek.
This revision is now accepted and ready to land.Mar 10 2016, 1:52 PM
jskladan accepted this revision.Mar 10 2016, 2:07 PM
jskladan added a reviewer: jskladan.
lbrabec accepted this revision.Mar 10 2016, 2:07 PM
lbrabec added a reviewer: lbrabec.

Oh btw, kudos to @lbrabec for finding the mem_handler issue here.

Is the fix to have newer pytest/pytest-cov or resetting the memory buffer or both?

In D774#14778, @tflink wrote:

Is the fix to have newer pytest/pytest-cov or resetting the memory buffer or both?

Both. Resetting memory buffer fixes our bug, newer pytest fixes some other pytest bug which also occurred on duplicate execution. I bumped pytest-cov as well, simply because I tested the latest version as my first step and it worked well, so I concluded we can update it also. If you want to avoid bumping pytest-cov, I can test properly even with the old version.

Both. Resetting memory buffer fixes our bug, newer pytest fixes some other pytest bug which also occurred on duplicate execution. I bumped pytest-cov as well, simply because I tested the latest version as my first step and it worked well, so I concluded we can update it also. If you want to avoid bumping pytest-cov, I can test properly even with the old version.

Nah, that isn't needed. Mostly wondering what fixed the issue both of those versions are in f24 so I'm not too worried about it.

This revision was automatically updated to reflect the committed changes.