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

Jww fix depreciation warnings #4

Merged
merged 4 commits into from
Sep 28, 2020
Merged

Conversation

iEv0lv3
Copy link
Contributor

@iEv0lv3 iEv0lv3 commented Sep 28, 2020

Description :: User Story

This PR resolves some of the pytest deprecation warnings related to aiohttp. It appears that some fixes have been merged into the main branch of aiohttp, however they are not available in a release at this point:

aio-libs/aiohttp#4477

The primary issue was creating a ClientSession as follows:

session = aiohttp.ClientSession()

The depreciation warnings stated that the ClientSession should be created within an async function, and the code has been updated to reflect that:

async def fetch_endpoint():
    async with aiohttp.ClientSession() as client:
        response = await fetch_people(client, company_id)
        
        return response

This changes how a single endpoint is called, and arguably is less convenient than the old method for reusability. Based on the issues thread posted above it appears that the depreciation warnings could be resolved in the next aiohttp update.

Type of Change

  • New Feature
  • Bug Fix
  • Refactor
  • Breaking Change
  • Testing

Environment and Dependencies

  • Packages Added
  • Packages Updated
  • Packages Removed
  • No Changes

Details:

Pull Request Notes

Add any notes here.

Pytest Results and Coverage

All tests pass and normalized test coverage is 100%.

---------- coverage: platform darwin, python 3.8.2-final-0 -----------
Name                                Stmts   Miss  Cover   Missing
-----------------------------------------------------------------
tap_zenefits/__init__.py                1      0   100%
tap_zenefits/helpers_dandelion.py      24      0   100%
tap_zenefits/zenefits.py               48      6    88%   49-51, 56-58
-----------------------------------------------------------------
TOTAL                                  73      6    92%

@iEv0lv3
Copy link
Contributor Author

iEv0lv3 commented Sep 28, 2020

All tests pass and normalized test coverage is 100%. Merging.

@iEv0lv3 iEv0lv3 merged commit 06ff963 into master Sep 28, 2020
@iEv0lv3 iEv0lv3 added api_endpoints bug Something isn't working documentation Improvements or additions to documentation tests labels Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api_endpoints bug Something isn't working documentation Improvements or additions to documentation tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant