diff --git a/kombu/tests/transport/virtual/test_base.py b/kombu/tests/transport/virtual/test_base.py index cbb1e58b..420862b3 100644 --- a/kombu/tests/transport/virtual/test_base.py +++ b/kombu/tests/transport/virtual/test_base.py @@ -1,5 +1,6 @@ from __future__ import absolute_import +import sys import warnings from kombu import Connection @@ -10,6 +11,9 @@ from kombu.compression import compress from kombu.tests.case import Case, Mock, patch, redirect_stdouts +PY3 = sys.version_info[0] == 3 +PRINT_FQDN = 'builtins.print' if PY3 else '__builtin__.print' + def client(**kwargs): return Connection(transport='kombu.transport.virtual:Transport', **kwargs) @@ -393,7 +397,7 @@ class test_Channel(Case): self.assertFalse(q._delivered) @patch('kombu.transport.virtual.emergency_dump_state') - @patch('__builtin__.print') + @patch(PRINT_FQDN) def test_restore_unacked_once_when_unrestored(self, print_, emergency_dump_state): q = self.channel.qos