Skip to content

Commit

Permalink
Making regression test put()'s transactional.
Browse files Browse the repository at this point in the history
Also removing AssertionError from list of retry classes.
  • Loading branch information
dhermes committed Jan 19, 2015
1 parent a060dc7 commit 280b7ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions regression/datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ def _get_post(self, id_or_name=None, post_content=None):

def _generic_test_post(self, name=None, key_id=None):
entity = self._get_post(id_or_name=(name or key_id))
datastore.put([entity])
with datastore.Transaction():
datastore.put([entity])

# Register entity to be deleted.
self.case_entities_to_delete.append(entity)
Expand Down Expand Up @@ -149,7 +150,8 @@ def test_save_key_self_reference(self):
entity['fullName'] = u'Full name'
entity['linkedTo'] = key # Self reference.

datastore.put([entity])
with datastore.Transaction():
datastore.put([entity])
self.case_entities_to_delete.append(entity)

query = datastore.Query(kind='Person')
Expand Down
2 changes: 1 addition & 1 deletion regression/regression_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
class RetryTestsMetaclass(type):

NUM_RETRIES = 2
FLAKY_ERROR_CLASSES = (AssertionError, NotFound)
FLAKY_ERROR_CLASSES = (NotFound,)

@staticmethod
def _wrap_class_attr(class_attr):
Expand Down

0 comments on commit 280b7ac

Please sign in to comment.