Skip to content

Conversation

@joshuarli
Copy link
Member

Back in Python 3.6, we couldn't remove the mock backport due to Python issue37972. Now, we can swap it out for the stdlib.

@joshuarli joshuarli marked this pull request as ready for review October 21, 2021 23:53
@joshuarli joshuarli requested review from a team October 21, 2021 23:53
@joshuarli joshuarli requested a review from a team as a code owner October 21, 2021 23:53
@joshuarli joshuarli requested a review from a team October 21, 2021 23:53
@joshuarli joshuarli requested review from a team as code owners October 21, 2021 23:53
@joshuarli joshuarli requested review from a team and removed request for a team October 21, 2021 23:53
@@ -1,5 +1,6 @@
import uuid
from datetime import timedelta
from unittest import mock, zip
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dang it, lol

Comment on lines +186 to +204

# @mock.patch("sentry.buffer.redis.RedisBuffer._make_key", mock.Mock(return_value="foo"))
# def test_incr_uses_signal_only(self):
# now = datetime(2017, 5, 3, 6, 6, 6, tzinfo=timezone.utc)
# client = self.buf.cluster.get_routing_client()
# model = mock.Mock()
# model.__name__ = "Mock"
# columns = {"times_seen": 1}
# filters = {"pk": 1, "datetime": now}
# self.buf.incr(model, columns, filters, extra={"foo": "bar", "datetime": now}, signal_only=True)
# result = client.hgetall("foo")
# assert result == {
# "e+foo": '["s","bar"]',
# "e+datetime": '["d","1493791566.000000"]',
# "f": '{"pk":["i","1"],"datetime":["d","1493791566.000000"]}',
# "i+times_seen": "1",
# "m": "mock.mock.Mock",
# "s": "1"
# }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we commenting this out?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

''' imo is not the best way to comment things out, just a small thing i noticed

@joshuarli joshuarli merged commit 29a0c53 into master Oct 22, 2021
@joshuarli joshuarli deleted the test/remove-mock-backport branch October 22, 2021 00:40
@github-actions github-actions bot locked and limited conversation to collaborators Nov 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants