Skip to content

Commit

Permalink
treat Row._next_id=None case as if next id should be 1
Browse files Browse the repository at this point in the history
Otherwise first call to Row.nextId() returns None, which leads to failures of
some tests if they are being run first (before other tests initialized next id
to non-None value).
  • Loading branch information
rutsky committed Feb 8, 2016
1 parent 54ec194 commit 9889b70
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion master/buildbot/test/fake/fakedb.py
Expand Up @@ -106,7 +106,8 @@ def __repr__(self):
return '%s(**%r)' % (self.__class__.__name__, self.values)

def nextId(self):
id, Row._next_id = Row._next_id, (Row._next_id or 1) + 1
id = Row._next_id if Row._next_id is not None else 1
Row._next_id = id + 1
return id

def hashColumns(self, *args):
Expand Down

0 comments on commit 9889b70

Please sign in to comment.