You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I just synced my custom_component repo with some changes from my integration in core and came across an issue with paths to fixtures.
As the docs require, the fixtures in both instances (core and custom) are in the fixtures dir alongside the tests. However, when calling load_fixture it was necessary for me to remove the integration's domain name from the path for the custom component.
Compare this example from core and example from my custom_component. If I don't have the domain name (trello) in the path when in core, the test breaks, and if I do have in the path in the custom component, it breaks on that side.
Keeping it the same as in core (domain included) results in this error:
FileNotFoundError: [Errno 2] No such file or directory: '<path to project>/tests/components/<domain>/fixtures/batch.json'
From looking at the docs, it seems like things should work without modification and I seem to be following what's necessary (a fixtures dir). Am I missing something here?
I'm on version 0.13.66.
The text was updated successfully, but these errors were encountered:
It seems like you are asking for this package to support more or less drop-in behavior to home-assistant core component. If we do this, we should track items needed for this goal. I assume you can put your tests in tests/components/<domain>/test_*.py, but I haven't tested this.
Also it would be good to ensure we support both cases as there are probably equally or more users who have standalone custom components and this would be a breaking change for them.
So I just synced my custom_component repo with some changes from my integration in core and came across an issue with paths to fixtures.
As the docs require, the fixtures in both instances (core and custom) are in the
fixtures
dir alongside the tests. However, when callingload_fixture
it was necessary for me to remove the integration's domain name from the path for the custom component.Compare this example from core and example from my custom_component. If I don't have the domain name (
trello
) in the path when in core, the test breaks, and if I do have in the path in the custom component, it breaks on that side.Keeping it the same as in core (domain included) results in this error:
FileNotFoundError: [Errno 2] No such file or directory: '<path to project>/tests/components/<domain>/fixtures/batch.json'
From looking at the docs, it seems like things should work without modification and I seem to be following what's necessary (a fixtures dir). Am I missing something here?
I'm on version
0.13.66
.The text was updated successfully, but these errors were encountered: