@@ -69,27 +69,26 @@ def test_streaming_response_list(self, client: Gitpod) -> None:
69
69
@pytest .mark .skip (reason = "Prism doesn't support JSONL responses yet" )
70
70
@parametrize
71
71
def test_method_watch (self , client : Gitpod ) -> None :
72
- event = client .events .watch ()
73
- assert_matches_type (JSONLDecoder [EventWatchResponse ], event , path = ["response" ])
72
+ event_stream = client .events .watch ()
73
+ assert_matches_type (JSONLDecoder [EventWatchResponse ], event_stream , path = ["response" ])
74
74
75
75
@pytest .mark .skip (reason = "Prism doesn't support JSONL responses yet" )
76
76
@parametrize
77
77
def test_method_watch_with_all_params (self , client : Gitpod ) -> None :
78
- event = client .events .watch (
78
+ event_stream = client .events .watch (
79
79
environment_id = "environmentId" ,
80
80
organization = True ,
81
81
)
82
- assert_matches_type (JSONLDecoder [EventWatchResponse ], event , path = ["response" ])
82
+ assert_matches_type (JSONLDecoder [EventWatchResponse ], event_stream , path = ["response" ])
83
83
84
84
@pytest .mark .skip (reason = "Prism doesn't support JSONL responses yet" )
85
85
@parametrize
86
86
def test_raw_response_watch (self , client : Gitpod ) -> None :
87
87
response = client .events .with_raw_response .watch ()
88
88
89
- assert response .is_closed is True
90
89
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
91
- event = response .parse ()
92
- assert_matches_type ( JSONLDecoder [ EventWatchResponse ], event , path = [ "response" ] )
90
+ stream = response .parse ()
91
+ stream . close ( )
93
92
94
93
@pytest .mark .skip (reason = "Prism doesn't support JSONL responses yet" )
95
94
@parametrize
@@ -98,8 +97,8 @@ def test_streaming_response_watch(self, client: Gitpod) -> None:
98
97
assert not response .is_closed
99
98
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
100
99
101
- event = response .parse ()
102
- assert_matches_type ( JSONLDecoder [ EventWatchResponse ], event , path = [ "response" ] )
100
+ stream = response .parse ()
101
+ stream . close ( )
103
102
104
103
assert cast (Any , response .is_closed ) is True
105
104
@@ -157,27 +156,26 @@ async def test_streaming_response_list(self, async_client: AsyncGitpod) -> None:
157
156
@pytest .mark .skip (reason = "Prism doesn't support JSONL responses yet" )
158
157
@parametrize
159
158
async def test_method_watch (self , async_client : AsyncGitpod ) -> None :
160
- event = await async_client .events .watch ()
161
- assert_matches_type (AsyncJSONLDecoder [EventWatchResponse ], event , path = ["response" ])
159
+ event_stream = await async_client .events .watch ()
160
+ assert_matches_type (AsyncJSONLDecoder [EventWatchResponse ], event_stream , path = ["response" ])
162
161
163
162
@pytest .mark .skip (reason = "Prism doesn't support JSONL responses yet" )
164
163
@parametrize
165
164
async def test_method_watch_with_all_params (self , async_client : AsyncGitpod ) -> None :
166
- event = await async_client .events .watch (
165
+ event_stream = await async_client .events .watch (
167
166
environment_id = "environmentId" ,
168
167
organization = True ,
169
168
)
170
- assert_matches_type (AsyncJSONLDecoder [EventWatchResponse ], event , path = ["response" ])
169
+ assert_matches_type (AsyncJSONLDecoder [EventWatchResponse ], event_stream , path = ["response" ])
171
170
172
171
@pytest .mark .skip (reason = "Prism doesn't support JSONL responses yet" )
173
172
@parametrize
174
173
async def test_raw_response_watch (self , async_client : AsyncGitpod ) -> None :
175
174
response = await async_client .events .with_raw_response .watch ()
176
175
177
- assert response .is_closed is True
178
176
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
179
- event = await response .parse ()
180
- assert_matches_type ( AsyncJSONLDecoder [ EventWatchResponse ], event , path = [ "response" ] )
177
+ stream = await response .parse ()
178
+ await stream . close ( )
181
179
182
180
@pytest .mark .skip (reason = "Prism doesn't support JSONL responses yet" )
183
181
@parametrize
@@ -186,7 +184,7 @@ async def test_streaming_response_watch(self, async_client: AsyncGitpod) -> None
186
184
assert not response .is_closed
187
185
assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
188
186
189
- event = await response .parse ()
190
- assert_matches_type ( AsyncJSONLDecoder [ EventWatchResponse ], event , path = [ "response" ] )
187
+ stream = await response .parse ()
188
+ await stream . close ( )
191
189
192
190
assert cast (Any , response .is_closed ) is True
0 commit comments