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

Replace aiohttp mock with patch in Advantage Air #104932

Merged
merged 11 commits into from Dec 9, 2023

Conversation

Bre77
Copy link
Contributor

@Bre77 Bre77 commented Dec 3, 2023

Proposed change

Completely removes aiohttp mock from tests, and replaces with patch.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@Bre77
Copy link
Contributor Author

Bre77 commented Dec 7, 2023

I have reverted my last two commits as I cannot figure out how to get that to work.

@bdraco
Copy link
Member

bdraco commented Dec 7, 2023

I have reverted my last two commits as I cannot figure out how to get that to work.

I'm not sure what you reverted since you force pushed. Is there something specific you need help getting to work?

@Bre77
Copy link
Contributor Author

Bre77 commented Dec 7, 2023

I have reverted my last two commits as I cannot figure out how to get that to work.

I'm not sure what you reverted since you force pushed. Is there something specific you need help getting to work?

If the PR is acceptable as is, I'd prefer to get this merged, as it's holding up a bug fix now (is going to require a test rewrite which this PR has achieved).

I tried putting my fixtures in the common.py but the auto formatting automatically removed the imports.

I'll give it another go once I've got the other issue sorted.

@bdraco
Copy link
Member

bdraco commented Dec 8, 2023

@Bre77 I cleaned up the duplicate code a bit for you. Feel free to revert my change if that's not what you wanted.

@bdraco
Copy link
Member

bdraco commented Dec 8, 2023

Happy to merge this as-is unless you want to clean it up more

@Bre77
Copy link
Contributor Author

Bre77 commented Dec 9, 2023

Its passing, so I am happy. Merge away.

Thanks for doing this! Is "conftest.py" a special filename that gets imported by pytest? Thats the part I couldnt figure out.

@bdraco bdraco merged commit e1df1f9 into home-assistant:dev Dec 9, 2023
23 checks passed
@Bre77 Bre77 deleted the aa-tests branch December 9, 2023 01:18
@github-actions github-actions bot locked and limited conversation to collaborators Dec 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants