Skip to content

Commit

Permalink
Ensure tags is always a list
Browse files Browse the repository at this point in the history
  • Loading branch information
mdboom committed May 25, 2022
1 parent 0c75cd9 commit 78ea3ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyperf/_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ def is_positive(value):


def is_tags(value):
if not isinstance(value, (list, tuple)):
if not isinstance(value, list):
return False
return all(isinstance(x, str) and x != 'all' for x in value)
return all(isinstance(x, str) and x not in ('all', '') for x in value)


def parse_load_avg(value):
Expand All @@ -68,7 +68,7 @@ def format_noop(value):
LOOPS = _MetadataInfo(format_number, (int,), is_strictly_positive, 'integer')
WARMUPS = _MetadataInfo(format_number, (int,), is_positive, 'integer')
SECONDS = _MetadataInfo(format_seconds, NUMBER_TYPES, is_positive, 'second')
TAGS = _MetadataInfo(format_generic, (tuple, list), is_tags, 'tag')
TAGS = _MetadataInfo(format_generic, (list,), is_tags, 'tag')

# Registry of metadata keys
METADATA = {
Expand Down

0 comments on commit 78ea3ec

Please sign in to comment.