diff options
author | 2016-01-27 18:15:11 +0000 | |
---|---|---|
committer | 2016-01-27 18:25:36 +0000 | |
commit | 6e1dd9ad065ce3b1c6635ad6d5b809730331289f (patch) | |
tree | 2c6457739102df172bc91330f6224c3905cb0ffd | |
parent | 8fff90d3a9657f9733c2bc15ed53b245f68139d4 (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.
-rw-r--r-- | src/python/grpcio/tests/unit/framework/interfaces/face/_receiver.py | 6 |
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: |