Skip to content
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

Fixture paths don't seem compatible with core #169

Open
ScottG489 opened this issue Oct 21, 2023 · 1 comment
Open

Fixture paths don't seem compatible with core #169

ScottG489 opened this issue Oct 21, 2023 · 1 comment

Comments

@ScottG489
Copy link

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.

@MatthewFlamm
Copy link
Owner

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.

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

No branches or pull requests

2 participants