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 flake8 #3783

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions sentry_sdk/_init_implementation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import warnings

from typing import TYPE_CHECKING

import sentry_sdk
Expand Down
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def _prepopulate_attributes(request):
attributes["server.address"] = request.host

try:
url = f"{request.scheme}://{request.host}{request.path}"
url = f"{request.scheme}://{request.host}{request.path}" # noqa: E231
if request.query_string:
attributes["url.full"] = f"{url}?{request.query_string}"
except Exception:
Expand Down
1 change: 0 additions & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pytest
from unittest import mock

import sentry_sdk
from sentry_sdk import (
capture_exception,
continue_trace,
Expand Down
49 changes: 0 additions & 49 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,55 +60,6 @@ def _normalize_distribution_name(name):
return re.sub(r"[-_.]+", "-", name).lower()


@pytest.mark.parametrize(
("input_str", "expected_output"),
(
(
"2021-01-01T00:00:00.000000Z",
datetime(2021, 1, 1, tzinfo=timezone.utc),
), # UTC time
(
"2021-01-01T00:00:00.000000",
datetime(2021, 1, 1).astimezone(timezone.utc),
), # No TZ -- assume local but convert to UTC
(
"2021-01-01T00:00:00Z",
datetime(2021, 1, 1, tzinfo=timezone.utc),
), # UTC - No milliseconds
(
"2021-01-01T00:00:00.000000+00:00",
datetime(2021, 1, 1, tzinfo=timezone.utc),
),
(
"2021-01-01T00:00:00.000000-00:00",
datetime(2021, 1, 1, tzinfo=timezone.utc),
),
(
"2021-01-01T00:00:00.000000+0000",
datetime(2021, 1, 1, tzinfo=timezone.utc),
),
(
"2021-01-01T00:00:00.000000-0000",
datetime(2021, 1, 1, tzinfo=timezone.utc),
),
(
"2020-12-31T00:00:00.000000+02:00",
datetime(2020, 12, 31, tzinfo=timezone(timedelta(hours=2))),
), # UTC+2 time
(
"2020-12-31T00:00:00.000000-0200",
datetime(2020, 12, 31, tzinfo=timezone(timedelta(hours=-2))),
), # UTC-2 time
(
"2020-12-31T00:00:00-0200",
datetime(2020, 12, 31, tzinfo=timezone(timedelta(hours=-2))),
), # UTC-2 time - no milliseconds
),
)
def test_datetime_from_isoformat(input_str, expected_output):
assert datetime_from_isoformat(input_str) == expected_output, input_str


@pytest.mark.parametrize(
"env_var_value,strict,expected",
[
Expand Down
Loading