diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2a77faded6994d6be9713a7ef6dd9249f33e6bb8..dd811a496b7b836cab1d9e0ef07270cd697c27dd 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 + - pip install --break-system-packages nose2 coverage requests yapf unittest2 - coverage run --append -m compile_definitions artifacts: paths: @@ -56,7 +56,7 @@ unittest_epoll_python27: extends: .before_test image: python:2.7 before_script: - - pip install nose2 coverage + - pip install nose2 coverage unittest2 - python setup.py install script: - coverage run --append -m nose2 -F -vv diff --git a/setup.py b/setup.py index 00144aeb8ee6bc92427cef2609af2ea32aca3c0a..bb97edd46ec040cb99c5c25e60dd8905c614d5ce 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"], + tests_require=["pytest", "coverage", "unittest2"], 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_framing.py b/tests/test_framing.py index 3cffff04f5e8030a31d70f6efc0e51359aa26302..3b4c10b2a1a2280dadbb16b896b8393e6cfe4769 100644 --- a/tests/test_framing.py +++ b/tests/test_framing.py @@ -7,8 +7,7 @@ from coolamqp.objects import argumentify class TestFraming(unittest.TestCase): - def test_something(self): + def test_enframing_arguments(self): buf = io.BytesIO() args = argumentify({'x-match': 'all', 'format': 'pdf'}) - res = enframe_table(buf, args) - print(repr(res)) + enframe_table(buf, args) diff --git a/tests/test_objects.py b/tests/test_objects.py index fbd7c76cfb2c60d07a5a5d1edf19b5e81b86114c..ee1c7cb46d39d20a990ce2449d74925cacc081eb 100644 --- a/tests/test_objects.py +++ b/tests/test_objects.py @@ -1,19 +1,18 @@ # coding=UTF-8 from __future__ import print_function, absolute_import, division -import unittest +import unittest2 import sys from coolamqp.objects import NodeDefinition, MessageProperties, Queue -class TestObjects(unittest.TestCase): +class TestObjects(unittest2.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)) - @unittest.skipIf(sys.platform.startswith('2'), 'Only Python 3 has assertWarns') def test_warning(self): with self.assertWarns(PendingDeprecationWarning): Queue(auto_delete=True, exclusive=False)