Skip to content

Commit

Permalink
Adjusted tests and added improved logging
Browse files Browse the repository at this point in the history
  • Loading branch information
eandersson committed Oct 22, 2021
1 parent 05771cb commit f61784d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 4 additions & 1 deletion amqpstorm/io.py
Expand Up @@ -282,7 +282,10 @@ def _receive(self):
if why.args[0] not in (EWOULDBLOCK, EAGAIN):
self._exceptions.append(AMQPConnectionError(why))
if self._running.is_set():
LOGGER.warning("Stopping inbound thread due to %s", why)
LOGGER.warning(
"Stopping inbound thread due to %s", why,
exc_info=True
)
self._running.clear()
return data_in

Expand Down
3 changes: 1 addition & 2 deletions amqpstorm/tests/utility.py
Expand Up @@ -114,7 +114,7 @@ def __init__(self, name='FakeFrame'):

def __iter__(self):
for attribute in ['_data_1']:
yield (attribute[1::], getattr(self, attribute))
yield attribute[1::], getattr(self, attribute)


class FakeSession(object):
Expand Down Expand Up @@ -197,7 +197,6 @@ def get_last_log(self):
def tearDown(self):
if self.validate_logging:
try:
self.assertFalse(self.logging_handler.messages['warning'])
self.assertFalse(self.logging_handler.messages['error'])
self.assertFalse(self.logging_handler.messages['critical'])
finally:
Expand Down

0 comments on commit f61784d

Please sign in to comment.