-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
test: remove mock compat #29501
test: remove mock compat #29501
Conversation
@@ -1,5 +1,6 @@ | |||
import uuid | |||
from datetime import timedelta | |||
from unittest import mock, zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dang it, lol
|
||
# @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" | ||
# } |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
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.