Ensure user_properties is a list

This commit is contained in:
Zac-HD 2018-09-26 22:02:14 +10:00
parent b1fbb2ab92
commit 6be2136f20
3 changed files with 12 additions and 3 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,6 +136,11 @@ class TestReport(BaseReport):
#: user properties is a list of tuples (name, value) that holds user
#: defined properties of the test
if user_properties is None:
user_properties = []
elif not isinstance(user_properties, list):
# This used to be a tuple; so cast for backwards-compatibility
user_properties = list(user_properties)
self.user_properties = user_properties
#: list of pairs ``(str, str)`` of extra information which needs to