Merge pull request #3075 from elliterate/bugs/fix-skipping-plugin-reporting

Assume not skipped by mark if attribute missing
This commit is contained in:
Bruno Oliveira 2018-01-06 13:56:07 -02:00 committed by GitHub
commit bc66f7e43f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 1 deletions

View File

@ -78,6 +78,7 @@ Henk-Jaap Wagenaar
Hugo van Kemenade
Hui Wang (coldnight)
Ian Bicking
Ian Lesperance
Jaap Broekhuizen
Jan Balster
Janne Vanhala

View File

@ -261,7 +261,7 @@ def pytest_runtest_makereport(item, call):
else:
rep.outcome = "passed"
rep.wasxfail = explanation
elif item._skipped_by_mark and rep.skipped and type(rep.longrepr) is tuple:
elif getattr(item, '_skipped_by_mark', False) and rep.skipped and type(rep.longrepr) is tuple:
# skipped by mark.skipif; change the location of the failure
# to point to the item definition, otherwise it will display
# the location of where the skip exception was raised within pytest

1
changelog/3074.bugfix Normal file
View File

@ -0,0 +1 @@
Fix skipping plugin reporting hook when test aborted before plugin setup hook.