-
Notifications
You must be signed in to change notification settings - Fork 143
Make aiohttp and requests optional dependencies
#177
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,6 @@ | |
| import asyncio | ||
| import copy | ||
| import ipaddress | ||
| import sys | ||
| import unittest | ||
| from abc import ABC, abstractmethod | ||
| from collections import defaultdict | ||
|
|
@@ -13,7 +12,6 @@ | |
| import pytest_httpserver | ||
| from pytest_httpserver import HeaderValueMatcher | ||
|
|
||
| sys.path.append("..") | ||
| import geoip2 | ||
| from geoip2.errors import ( | ||
| AddressNotFoundError, | ||
|
|
@@ -405,6 +403,7 @@ class TestClient(TestBaseClient): | |
| client: Client | ||
|
|
||
| def setUp(self) -> None: | ||
| pytest.importorskip("requests") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win Cover missing-dependency behavior instead of only skipping it.
Also applies to: 420-420 🤖 Prompt for AI Agents |
||
| self.client_class = Client | ||
| self.client = Client(42, "abcdef123456") | ||
| self.client._base_uri = self.httpserver.url_for("/geoip/v2.1") # noqa: SLF001 | ||
|
|
@@ -418,6 +417,7 @@ class TestAsyncClient(TestBaseClient): | |
| client: AsyncClient | ||
|
|
||
| def setUp(self) -> None: | ||
| pytest.importorskip("aiohttp") | ||
| self._loop = asyncio.new_event_loop() | ||
| self.client_class = AsyncClient | ||
| self.client = AsyncClient(42, "abcdef123456") | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.