Skip to content

Add support for connecting as named user #41

New issue

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

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

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

OliverWoolland
Copy link

Summary

Adds optional authentication support by allowing username and password to be set via CLI arguments.

This should enable connections to brokers which disallow anonymous connections or if authentication is expected.

Defaults remain unchanged (guest/guest), so existing usage should be unaffected.

Details

  • Adds --mqtt-username and --mqtt-password CLI args to pytest-mqtt
  • Updates the fixtures / clients to accept credentials
  • Documents new arguments in README.rst

Copy link

codecov bot commented Jun 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.08%. Comparing base (ab524fd) to head (0e29dba).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #41      +/-   ##
==========================================
+ Coverage   95.90%   96.08%   +0.18%     
==========================================
  Files           5        5              
  Lines         171      179       +8     
==========================================
+ Hits          164      172       +8     
  Misses          7        7              
Flag Coverage Δ
unittests 96.08% <100.00%> (+0.18%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@OliverWoolland OliverWoolland marked this pull request as draft June 25, 2025 10:28
@OliverWoolland OliverWoolland marked this pull request as ready for review June 25, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant