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

Fix fan_init test #16865

Merged
merged 2 commits into from
Sep 26, 2018
Merged

Fix fan_init test #16865

merged 2 commits into from
Sep 26, 2018

Conversation

cdce8p
Copy link
Member

@cdce8p cdce8p commented Sep 25, 2018

Description:

Renamed tests/components/fan/__init__.py to fan/test_init.py, since it includes a test for the base FanEntity. Also updated it to conform with the current fan model.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

@homeassistant homeassistant added small-pr PRs with less than 30 lines. cla-signed labels Sep 25, 2018
@ghost ghost assigned cdce8p Sep 25, 2018
@ghost ghost added the in progress label Sep 25, 2018
@balloob
Copy link
Member

balloob commented Sep 25, 2018

All folders need to have a __init__.py file for PyTest to discover tests.

@cdce8p
Copy link
Member Author

cdce8p commented Sep 25, 2018

I looked through the documentation. It isn't necessary for discovery, just to prevent name collisions. Noticed that tests/components/cover and homekit are missing __init__ files as well and they get tested. However I will open a PR shortly to add them.


Edit: This is true for py3.3 and above. See note block: https://docs.pytest.org/en/latest/goodpractices.html#tests-as-part-of-application-code

@balloob balloob merged commit bfa1c55 into home-assistant:dev Sep 26, 2018
@ghost ghost removed the in progress label Sep 26, 2018
@cdce8p cdce8p deleted the fix-fan-test branch September 26, 2018 08:17
@balloob balloob mentioned this pull request Oct 12, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Feb 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed small-pr PRs with less than 30 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants