labgrid-project / labgrid

Embedded systems control library for development, testing and installation
https://labgrid.readthedocs.io/
Other
335 stars 174 forks source link

labgrid plugin breaks pytest if logging plugin is disabled #1209

Closed edersondisouza closed 1 year ago

edersondisouza commented 1 year ago

Why is it that the pytest plugin is registered by default, and not only on the "dev environment"?

This can cause issues if someone is running an unrelated pytest session on a different project, and labgrid plugin is loaded by pytest but fails (due for instance, the other project setting -p no:logging).

Is there a good reason for that? It seems to me that running pytest is more important for development anyway.

Emantor commented 1 year ago

Pytest always loads all plugins by default, see Pytest plugin docs. If labgrid is available within your environment, pytest will load the labgrid pytest plugin for testing.

However the labgrid pytest plugin failing if the logging plugin is no loaded is a bug. We should fix that and maybe fallback to simple printing in this case.

edersondisouza commented 1 year ago

I see - then I guess fixing labgrid plugin is the way to go. Should I file a specific issue for that?

Emantor commented 1 year ago

I see - then I guess fixing labgrid plugin is the way to go. Should I file a specific issue for that?

Not necessary, we can reuse this one and adjust the title.