Skip to content

Commit 280b7ac

Browse files
committed
Making regression test put()'s transactional.
Also removing AssertionError from list of retry classes.
1 parent a060dc7 commit 280b7ac

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

regression/datastore.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ def _get_post(self, id_or_name=None, post_content=None):
8080

8181
def _generic_test_post(self, name=None, key_id=None):
8282
entity = self._get_post(id_or_name=(name or key_id))
83-
datastore.put([entity])
83+
with datastore.Transaction():
84+
datastore.put([entity])
8485

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

152-
datastore.put([entity])
153+
with datastore.Transaction():
154+
datastore.put([entity])
153155
self.case_entities_to_delete.append(entity)
154156

155157
query = datastore.Query(kind='Person')

regression/regression_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
class RetryTestsMetaclass(type):
3737

3838
NUM_RETRIES = 2
39-
FLAKY_ERROR_CLASSES = (AssertionError, NotFound)
39+
FLAKY_ERROR_CLASSES = (NotFound,)
4040

4141
@staticmethod
4242
def _wrap_class_attr(class_attr):

0 commit comments

Comments
 (0)