Closed zedfmario closed 6 months ago
Attention: Patch coverage is 95.83333%
with 1 lines
in your changes are missing coverage. Please review.
Project coverage is 95.45%. Comparing base (
0e4c401
) to head (6d94524
). Report is 1 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
pytest_mqtt/mosquitto.py | 90.00% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Dear Mario,
thank you so much for submitting this patch, and apologies for missing it up until now. Your contribution is well received, and will be part of the next release of pytest-mqtt.
With kind regards, Andreas.
Dear Mario,
we push a few adjustments to your branch, along the lines of our suggestions, and renamed the CLI parameters to --mqtt-host
resp. --mqtt-port
. Thanks again for your contribution!
With kind regards, Andreas.
Hi again,
pytest-mqtt 0.4.0 has been released, including corresponding improvements from your pen, slightly adjusted. Thank you very much!
With kind regards, Andreas.
TL;DR
Adding two optional pytest command line arguments describing a MQTT broker:
--mqtt_host
(defaults tolocalhost
)--mqtt_port
(defaults to1883
)Hi there,
First of all, thank you for the project. It's been super helpful while developing MQTT related features.
However, while using the library I found it didn't quite match my current needs, so I tried to find a way to solve my issue. I hope you find this PR suitable for your package. Since it's my first time contributing to your project, I'm not 100% sure I'm covering all the requirements. Feel free to suggest any changes you may find to match your criteria, please.
I needed to test against a remote MQTT broker, not running on localhost. All connections to the MQTT broker were hardcoded to
localhost:1883
though. I added the chance to make both values configurable, based on pytest cli arguments, using therequest
fixture.Example of use
Given the following docker-compose.yml file
and starting the MQTT server on port
11883
running pytest against the new port works
and the logs on the mqtt broker running on docker: