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

Use a fixture for dialogflow calls in unit tests #17999

Merged
merged 2 commits into from Nov 1, 2018

Conversation

Projects
None yet
5 participants
@rohankapoorcom
Contributor

rohankapoorcom commented Oct 30, 2018

Description:

Cleaned up the dialogflow unit tests to use a fixture instead of a global.

Checklist:

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

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
@houndci-bot

Some files could not be reviewed due to errors:

Traceback (most recent call last):
Traceback (most recent call last):
  File "/home/linters/.local/bin/flake8", line 7, in 
    from flake8.main.cli import main
ModuleNotFoundError: No module named 'flake8'
@houndci-bot

Some files could not be reviewed due to errors:

Traceback (most recent call last):
Traceback (most recent call last):
  File "/home/linters/.local/bin/flake8", line 7, in 
    from flake8.main.cli import main
ModuleNotFoundError: No module named 'flake8'

@balloob balloob merged commit 23290fa into home-assistant:dev Nov 1, 2018

5 checks passed

Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 93.013%
Details

@wafflebot wafflebot bot removed the in progress label Nov 1, 2018

@rohankapoorcom rohankapoorcom deleted the rohankapoorcom:dialogflow-test-fixture branch Nov 1, 2018


@pytest.fixture
async def fixture(hass, aiohttp_client):
"""Initialize a Home Assistant server for testing this module."""
async def calls(hass, fixture):

This comment has been minimized.

@MartinHjelmare

MartinHjelmare Nov 1, 2018

Member

I didn't think that coroutines were supported as pytest fixtures without using pytest-asyncio.

This comment has been minimized.

@balloob

balloob Nov 2, 2018

Member

That is a good point, yet it passes…

@balloob balloob referenced this pull request Nov 9, 2018

Merged

0.82 #18335

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment