eclipse-paho / eclipse-paho/paho.mqtt.python
Unit tests don't seem to work
- Dominant language
- Python
- Stars
- 2.4k
- Forks
- 742
- Avg merge
- 12d 48m
- Merged PRs (30d)
- 1
Description
# Prerequisites
*Note: You may remove this section prior to submitting your report.*
A small team of volunteers monitors issues. Please help us to help you by making it simple to understand and, if possible,
replicate your issue. Prior to reporting a bug please:
- [x] Test the latest release of the library.
- [x] Search existing issues.
- [x] Read the relevant documentation.
- [x] Review your server configuration and logs.
- [x] Consider testing against a different server (e.g. [mqtt.eclipseprojects.io](https://mqtt.eclipseprojects.io/) or [test.mosquitto.org](https://test.mosquitto.org/))
- [x] If possible, test using another tool (e.g. [MQTTX](https://mqttx.app/) / [mosquitto_sub](https://mosquitto.org/man/mosquitto_sub-1.html))
to confirm the issue is specific to this client.
- [x] If you are unsure if you have found a bug, please consider asking on [stackoverflow](https://stackoverflow.com/) for a quicker response.
# Bug Description
*Please provide a clear and concise description of the bug.*
The contributing simply says:
> Ensure that all new and existing tests pass by running tox
But as far as I can see this is impossible without significant code changes, firstly there is no setup.py which is a requirement of tox. Setting:
`skipsdist = True`
in the tox.ini at least gets tox to run. So far I've had no luck in any of the tests working though.
The Makefile doesn't use tox at all and running:
`make test`
does run some tests although with a lot of failures. Basically getting lots of socket timeouts so something isn't happy creating the test server I think.
# Reproduction
*Please provide detailed steps showing how to replicate the issue (it's difficult to fix an issue we cannot replicate).
If errors are output then include the full error (including any stack trace).*
*Most issues should include a [minimal example](https://stackoverflow.com/help/minimal-reproducible-example) that
demonstrates the issue (ideally one that can be run without modification, i.e. runnable code using a public broker).*
checkout the code (or make a fork if you prefer)
run tox
get error:
> ERROR: No setup.py file found. The expected location is:
> /paho/paho.mqtt.python/setup.py
> You can
> 1. Create one:
> https://packaging.python.org/tutorials/distributing-packages/#setup-py
> 2. Configure tox to avoid running sdist:
> https://tox.readthedocs.io/en/latest/example/general.html#avoiding-expensive-sdist
run `make test`
get results:
> 30 failed, 71 passed, 21 skipped, 4 xfailed, 30 errors in 338.79s (0:05:38)
# Environment
* Python version: 3.9
* Library version: master
* Operating system (including version): AlmaLinux release 8.9 (Midnight Oncilla)
* MQTT server (name, version, configuration, hosting details):
# Logs
For many issues, especially when you cannot provide code to replicate the issue, it's helpful to include logs. Please
consider including:
* library logs; see [the readme](https://github.com/eclipse/paho.mqtt.python#enable_logger) and [logger example](https://github.com/eclipse/paho.mqtt.python/blob/master/examples/client_logger.py).
* broker logs (availability will depend the server in use)
Contributor guide
Assessment
This issue has not been assessed yet.