Skip to content

Commit

Permalink
move zmq.tests deprecation warning to top-level
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed May 25, 2024
1 parent 4145506 commit 0c69dfe
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
16 changes: 1 addition & 15 deletions tests/zmq_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,9 @@ class BaseZMQTestCase(TestCase):
test_timeout_seconds = int(os.environ.get("ZMQ_TEST_TIMEOUT") or 60)
sockets: List[zmq.Socket]

@property
def _is_pyzmq_test(self):
return self.__class__.__module__.split(".", 1)[0] == __name__.split(".", 1)[0]

@property
def _should_test_timeout(self):
return (
self._is_pyzmq_test
and hasattr(signal, 'SIGALRM')
and self.test_timeout_seconds
)
return hasattr(signal, 'SIGALRM') and self.test_timeout_seconds

@property
def Context(self):
Expand All @@ -95,12 +87,6 @@ def _alarm_timeout(self, timeout, *args):

def setUp(self):
super().setUp()
if not self._is_pyzmq_test:
warnings.warn(
"zmq.tests.BaseZMQTestCase is deprecated in pyzmq 25, we recommend managing your own contexts and sockets.",
DeprecationWarning,
stacklevel=3,
)
if self.green and not have_gevent:
raise SkipTest("requires gevent")

Expand Down
6 changes: 0 additions & 6 deletions zmq/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,6 @@ def _alarm_timeout(self, timeout, *args):

def setUp(self):
super().setUp()
if not self._is_pyzmq_test:
warnings.warn(
"zmq.tests.BaseZMQTestCase is deprecated in pyzmq 25, we recommend managing your own contexts and sockets.",
DeprecationWarning,
stacklevel=3,
)
if self.green and not have_gevent:
raise SkipTest("requires gevent")

Expand Down

0 comments on commit 0c69dfe

Please sign in to comment.