Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

test_etcd.py skipped and gives error when enabled #2001

Closed
FrankK-1234 opened this issue May 17, 2024 · 0 comments
Closed

test_etcd.py skipped and gives error when enabled #2001

FrankK-1234 opened this issue May 17, 2024 · 0 comments

Comments

@FrankK-1234
Copy link
Contributor

Hi, I'm new with kombu and tried to run the tests via tox (python 3.12). I saw and investigated why etcd is skipped.

The message I saw was:
SKIPPED [1] t/unit/transport/test_etcd.py:11: could not import 'etcd': No module named 'etcd'

This is because the module etcd is not in de tox requirements (never added?). A requirements file does exists in requirements/extras/etcd.txt. So added it to (what I think is the most logical file) requirements/test-ci.txt, with '-r extras/etcd.txt'

That resulted in test_etcd being executed however with error on self.patch.

self = <t.unit.transport.test_etcd.test_Etcd object at 0x7f17cdb983e0>

    def setup_method(self):
        self.connection = Mock()
        self.connection.client.transport_options = {}
        self.connection.client.port = 2739
>       self.client = self.patch('etcd.Client').return_value
E       AttributeError: 'test_Etcd' object has no attribute 'patch'

t/unit/transport/test_etcd.py:19: AttributeError

Looking at the code changes it might (not sure) not have been working since it was ported to pytest: Port etcd tests to py.test. I assume the old class 'Case' implemented the patch function.

After changing the patch to patching and the connection setup similar to test_consul.py it passed the test.

I'll prepare and propose a pull request (also my first time).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants