Closed alexschwantes closed 8 months ago
hmm no luck. can't get the test environment running on local pc so just had a quick stab at fixing the test. can try again later, but there is an issue with @pytest.mark.asyncio not working with localhost :(
ok so got them working. raised a new bug regarding localhost issue https://github.com/MatthewFlamm/pytest-homeassistant-custom-component/issues/178
I also removed @pytest.mark.asyncio marker from tests. as from https://pypi.org/project/pytest-asyncio/0.20.1/
Regarding asyncio_mode = auto. When the mode is auto, all discovered async tests are considered asyncio-driven even if they have no @pytest.mark.asyncio marker.
I was also getting an unusual timezone error until I installed tzdata, so I added that to requirements.txt
Thanks, just a couple of quick thoughts:
The docker container is probably a better solution than the existing script, I'll see about adding that to the docs.
There was a reason for the @pytest.mark.asyncio. The tests would randomly fail due to Home Assistant running clean up code in the background. This was the solution I found. I think there was another uglier workaround but it was a couple months ago so I'm not sure I remember what it was. I just need to test things out to see if this reoccurs. (Edit: this doesn't seem to be an issue anymore)
I ran into the same "test tried to use a socket" issue, if I remember correctly it was an issue specific to Windows. I think this was a relevant issue https://github.com/microsoft/vscode-python/issues/22383. I believe everything worked when I ran under Linux.
Overall the code looked good from the quick look I took at it. I'm not near a computer now but once I get a chance I just want to double check that the tests don't start failing due to removing the mark.asyncio. I think it occurred based on whether you ran the tests individually or all at once from what I remember.
Looks good, thank you.
This adds an configurable list prefix that will show in Home Assistant Todo's to aid in identifying lists. The default it is blank/nothing.
This can be useful in households where multiple people may want to have access to their shopping list, such that you could then have them named
freds shopping list
andmaria's shopping list
. Without this, you would just have two lists calledshopping list
, which would get confusing. It can also be useful when you may have multiple lists synced from different services to be able to differentiate them.This is the default behaviour in some other list integrations such as anylist, that adds a hard coded
Anylist
to each list.I had a go at the translations using google translate so they may be a little bit off.
Also, regarding generating a new token, I didn't have any luck with the method in the readme because I had different versions. I did find a much easier method using a docker container as outlined here https://github.com/fcastilloec/gkeep-list-sync/blob/218f1ff0af82b1815e0903a62d40f585ea623f7d/README.md#authentication-options