aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python
diff options
context:
space:
mode:
authorGravatar Nathaniel Manista <nathaniel@google.com>2016-01-27 18:15:11 +0000
committerGravatar Nathaniel Manista <nathaniel@google.com>2016-01-27 18:25:36 +0000
commit6e1dd9ad065ce3b1c6635ad6d5b809730331289f (patch)
tree2c6457739102df172bc91330f6224c3905cb0ffd /src/python
parent8fff90d3a9657f9733c2bc15ed53b245f68139d4 (diff)
Fix reporting unexpected abortions in event tests
Writing "<format string containing one directive> % <expression>" instead of "<format string containing one directive> % (<expression>,)" is always a problem; the particular problem in this case came from face.Abortion being a subclass of a class created with collections.namedtuple.
Diffstat (limited to 'src/python')
-rw-r--r--src/python/grpcio/tests/unit/framework/interfaces/face/_receiver.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/python/grpcio/tests/unit/framework/interfaces/face/_receiver.py b/src/python/grpcio/tests/unit/framework/interfaces/face/_receiver.py
index 2e444ff09d..42a7f4e3b8 100644
--- a/src/python/grpcio/tests/unit/framework/interfaces/face/_receiver.py
+++ b/src/python/grpcio/tests/unit/framework/interfaces/face/_receiver.py
@@ -1,4 +1,4 @@
-# Copyright 2015, Google Inc.
+# Copyright 2015-2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -76,7 +76,7 @@ class Receiver(face.ResponseReceiver):
def unary_response(self):
with self._condition:
if self._abortion is not None:
- raise AssertionError('Aborted with abortion "%s"!' % self._abortion)
+ raise AssertionError('Aborted: "{}"!'.format(self._abortion))
elif len(self._responses) != 1:
raise AssertionError(
'%d responses received, not exactly one!', len(self._responses))
@@ -88,7 +88,7 @@ class Receiver(face.ResponseReceiver):
if self._abortion is None:
return list(self._responses)
else:
- raise AssertionError('Aborted with abortion "%s"!' % self._abortion)
+ raise AssertionError('Aborted: "{}"!'.format(self._abortion))
def abortion(self):
with self._condition: