Skip to content

Commit

Permalink
ref: type iso_format(...) (#79209)
Browse files Browse the repository at this point in the history
I'm planning on removing this function, typing it helps ease that
transition and avoid a bunch of manual fixes later

<!-- Describe your PR here. -->
  • Loading branch information
asottile-sentry authored Oct 16, 2024
1 parent 68e5b1d commit 987652b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/sentry/testutils/helpers/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
__all__ = ["iso_format", "before_now", "timestamp_format"]


def iso_format(date):
def iso_format(date: datetime) -> str:
return date.isoformat()[:19]


Expand Down
3 changes: 2 additions & 1 deletion tests/snuba/api/serializers/test_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,8 @@ def test_seen_stats(self):
# result is rounded down to nearest second
assert iso_format(result["lastSeen"]) == iso_format(self.min_ago)
assert iso_format(result["firstSeen"]) == iso_format(group_env.first_seen)
assert iso_format(group_env2.first_seen) > iso_format(group_env.first_seen)
assert group_env2.first_seen is not None
assert group_env2.first_seen > group_env.first_seen
assert result["userCount"] == 3

result = serialize(
Expand Down

0 comments on commit 987652b

Please sign in to comment.