MatthewFlamm / pytest-homeassistant-custom-component

Package to automatically extract testing plugins from Home Assistant for custom component testing
MIT License
66 stars 10 forks source link

Fix recorder error #116

Closed mvdwetering closed 2 years ago

mvdwetering commented 2 years ago

This change gets rid of the recorder error with HA 2022.5 that is mentioned in #115 . It seems to generate fine and the tests of the generated pytest-homeassistant-custom-component run without errors.

Changes feel a bit brittle/hacky especially the docstring code. There are probably better ways to implement this, but not really a Python expert :/

MatthewFlamm commented 2 years ago

Changes feel a bit brittle/hacky especially the docstring code. There are probably better ways to implement this, but not really a Python expert :/

This whole package is a bit brittle/hacky by construction, not to mention my laziness in sticking with the script like nature.

MatthewFlamm commented 2 years ago

I think your solution of using relative imports all the way fixed the circular import issue I was running into. I will take a longer look at the docstring piece.

I need to work on a better CI for new contributors since the CI doesn't run the generate script. I will test locally before merging.