diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index dd811a496b7b836cab1d9e0ef07270cd697c27dd..5fd1bf07339300fd8e6d14f235fc3001e55193d8 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -10,7 +10,7 @@ stages:
       alias: rabbitmq
   before_script:
     - python setup.py install
-    - pip install --break-system-packages nose2 coverage requests yapf unittest2
+    - pip install --break-system-packages nose2 coverage requests yapf
     - coverage run --append -m compile_definitions
   artifacts:
     paths:
@@ -56,10 +56,10 @@ unittest_epoll_python27:
   extends: .before_test
   image: python:2.7
   before_script:
-    - pip install nose2 coverage unittest2
+    - pip install nose2
     - python setup.py install
   script:
-    - coverage run --append -m nose2 -F -vv
+    - nose2 -F -vv
   variables:
     AMQP_HOST: "rabbitmq"
   after_script:
diff --git a/setup.py b/setup.py
index bb97edd46ec040cb99c5c25e60dd8905c614d5ce..00144aeb8ee6bc92427cef2609af2ea32aca3c0a 100644
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,7 @@ setup(keywords=['amqp', 'rabbitmq', 'client', 'network', 'ha', 'high availabilit
       version=__version__,
       packages=find_packages(include=['coolamqp', 'coolamqp.*']),
       install_requires=['six'],
-      tests_require=["pytest", "coverage", "unittest2"],
+      tests_require=["pytest", "coverage"],
       test_suite='nose2.collector.collector',
       python_requires='!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*',
       extras_require={
diff --git a/tests/test_objects.py b/tests/test_objects.py
index ee1c7cb46d39d20a990ce2449d74925cacc081eb..37f335d760052f810afdaf1563b9de3100e14174 100644
--- a/tests/test_objects.py
+++ b/tests/test_objects.py
@@ -1,21 +1,24 @@
 # coding=UTF-8
 from __future__ import print_function, absolute_import, division
 
-import unittest2
-import sys
+import unittest
+import warnings
 
 from coolamqp.objects import NodeDefinition, MessageProperties, Queue
 
 
-class TestObjects(unittest2.TestCase):
+class TestObjects(unittest.TestCase):
     def test_message_properties(self):
         empty_p_msg = MessageProperties()
         ce_p_msg = MessageProperties(content_encoding=b'wtf')
         self.assertIn('wtf', str(ce_p_msg))
 
     def test_warning(self):
-        with self.assertWarns(PendingDeprecationWarning):
+        warnings.resetwarnings()
+        with warnings.catch_warnings(record=True) as w:
             Queue(auto_delete=True, exclusive=False)
+        self.assertEqual(len(w), 1)
+        self.assertTrue(issubclass(w[0].category, PendingDeprecationWarning))
 
     def test_node_definition_from_amqp(self):
         n1 = NodeDefinition(u'amqp://ala:ma@kota/psa')