Skip to content

Commit 3a3cda5

Browse files
committed
Fix erroneous use of "is"
The `is` operator checks for identity, not equality. To check for an empty list, one should use either: if roles == []: Or just take advantage of the fact that an empty list is `False` when used in a boolean expression, and write: if not roles: This commit takes the second option.
1 parent 3423f2c commit 3a3cda5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • esileapclient/tests/functional

esileapclient/tests/functional/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def _init_dummy_project(self, name, roles, parent=None):
121121
'domain': 'default'
122122
}
123123

124-
if roles is []:
124+
if not roles:
125125
raise ValueError('No roles specified when initializing dummy \
126126
project %s' % name)
127127
elif type(roles) is str:

0 commit comments

Comments
 (0)