Merge pull request #4041 from Zac-HD/user-properties-type

Ensure user_properties is a list
This commit is contained in:
Bruno Oliveira 2018-09-27 08:04:30 -03:00 committed by GitHub
commit d2fc7ca6e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 4 deletions

View File

@ -10,6 +10,7 @@ Ahn Ki-Wook
Alan Velasco
Alexander Johnson
Alexei Kozlenok
Allan Feldman
Anatoly Bubenkoff
Anders Hovmöller
Andras Tim
@ -179,6 +180,7 @@ Raphael Pierzina
Raquel Alegre
Ravi Chandra
Roberto Polli
Roland Puntaier
Romain Dorgueil
Roman Bolshakov
Ronny Pfannschmidt
@ -223,6 +225,5 @@ Wim Glenn
Wouter van Ackooy
Xuan Luong
Xuecong Liao
Zac Hatfield-Dodds
Zoltán Máté
Roland Puntaier
Allan Feldman

View File

@ -0,0 +1,3 @@
The ``.user_properties`` attribute of ``TestReport`` objects is a list
of (name, value) tuples, but could sometimes be instantiated as a tuple
of tuples. It is now always a list.

View File

@ -110,7 +110,7 @@ class TestReport(BaseReport):
when,
sections=(),
duration=0,
user_properties=(),
user_properties=None,
**extra
):
#: normalized collection node id
@ -136,7 +136,7 @@ class TestReport(BaseReport):
#: user properties is a list of tuples (name, value) that holds user
#: defined properties of the test
self.user_properties = user_properties
self.user_properties = list(user_properties or [])
#: list of pairs ``(str, str)`` of extra information which needs to
#: marshallable. Used by pytest to add captured text