Skip to content
Merged
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
18 changes: 9 additions & 9 deletions tests/instrumentation/grpc_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

grpc = pytest.importorskip("grpc")

from unittest.mock import MagicMock, call, patch
from unittest.mock import MagicMock, patch

pytestmark = pytest.mark.grpc

Expand Down Expand Up @@ -209,7 +209,7 @@ def test_no_interceptors_adds_server_interceptor_via_kwargs(self):
kwargs={},
)

interceptors_passed = wrapped.call_args.kwargs["interceptors"]
interceptors_passed = wrapped.call_args[1]["interceptors"]
assert interceptors_passed[0] is MockInterceptor.return_value
assert result is fake_server

Expand All @@ -229,7 +229,7 @@ def test_existing_interceptors_via_kwargs_prepends_server_interceptor(self):
kwargs={"interceptors": [existing]},
)

interceptors_passed = wrapped.call_args.kwargs["interceptors"]
interceptors_passed = wrapped.call_args[1]["interceptors"]
assert interceptors_passed[0] is MockInterceptor.return_value
assert interceptors_passed[1] is existing

Expand All @@ -251,7 +251,7 @@ def test_existing_interceptors_via_positional_args(self):
kwargs={},
)

call_args = wrapped.call_args.args
call_args = wrapped.call_args[0]
interceptors_passed = call_args[2]
assert interceptors_passed[0] is MockInterceptor.return_value
assert interceptors_passed[1] is existing
Expand All @@ -272,7 +272,7 @@ def test_no_interceptors_in_positional_args_uses_kwargs(self):
kwargs={},
)

interceptors_passed = wrapped.call_args.kwargs["interceptors"]
interceptors_passed = wrapped.call_args[1]["interceptors"]
assert interceptors_passed[0] is MockInterceptor.return_value


Expand All @@ -298,7 +298,7 @@ def test_no_interceptors_adds_async_interceptor_via_kwargs(self):
kwargs={},
)

interceptors_passed = wrapped.call_args.kwargs["interceptors"]
interceptors_passed = wrapped.call_args[1]["interceptors"]
assert interceptors_passed[0] is MockInterceptor.return_value
assert result is fake_server

Expand All @@ -318,7 +318,7 @@ def test_existing_interceptors_via_kwargs_prepends_async_interceptor(self):
kwargs={"interceptors": [existing]},
)

interceptors_passed = wrapped.call_args.kwargs["interceptors"]
interceptors_passed = wrapped.call_args[1]["interceptors"]
assert interceptors_passed[0] is MockInterceptor.return_value
assert interceptors_passed[1] is existing

Expand All @@ -339,7 +339,7 @@ def test_existing_interceptors_via_positional_args(self):
kwargs={},
)

call_args = wrapped.call_args.args
call_args = wrapped.call_args[0]
interceptors_passed = call_args[2]
assert interceptors_passed[0] is MockInterceptor.return_value
assert interceptors_passed[1] is existing
Expand All @@ -360,5 +360,5 @@ def test_no_interceptors_in_short_positional_args_uses_kwargs(self):
kwargs={},
)

interceptors_passed = wrapped.call_args.kwargs["interceptors"]
interceptors_passed = wrapped.call_args[1]["interceptors"]
assert interceptors_passed[0] is MockInterceptor.return_value
Loading