Skip to content

Commit 21d0ad7

Browse files
revert warning fixes
1 parent f64b211 commit 21d0ad7

File tree

9 files changed

+29
-30
lines changed

9 files changed

+29
-30
lines changed

tests/adapter_tests/django/test_django_settings.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
DATABASES = {
33
"default": {
44
"ENGINE": "django.db.backends.sqlite3",
5-
"NAME": ":memory:",
5+
"NAME": "logs/db.sqlite3",
66
}
77
}
8-
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
98
# Django 4 warning: The default value of USE_TZ will change from False to True in Django 5.0.
109
# Set USE_TZ to False in your project settings if you want to keep the current default behavior.
1110
USE_TZ = False

tests/adapter_tests/starlette/test_fastapi.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ async def endpoint(req: Request):
9494
client = TestClient(api)
9595
response = client.post(
9696
"/slack/events",
97-
content=body,
97+
data=body,
9898
headers=self.build_headers(timestamp, body),
9999
)
100100
assert response.status_code == 200
@@ -138,7 +138,7 @@ async def endpoint(req: Request):
138138
client = TestClient(api)
139139
response = client.post(
140140
"/slack/events",
141-
content=body,
141+
data=body,
142142
headers=self.build_headers(timestamp, body),
143143
)
144144
assert response.status_code == 200
@@ -182,7 +182,7 @@ async def endpoint(req: Request):
182182
client = TestClient(api)
183183
response = client.post(
184184
"/slack/events",
185-
content=body,
185+
data=body,
186186
headers=self.build_headers(timestamp, body),
187187
)
188188
assert response.status_code == 200
@@ -254,7 +254,7 @@ async def endpoint(req: Request, foo: str = Depends(get_foo)):
254254
client = TestClient(api)
255255
response = client.post(
256256
"/slack/events",
257-
content=body,
257+
data=body,
258258
headers=self.build_headers(timestamp, body),
259259
)
260260
assert response.status_code == 200

tests/adapter_tests/starlette/test_starlette.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ async def endpoint(req: Request):
9797
client = TestClient(api)
9898
response = client.post(
9999
"/slack/events",
100-
content=body,
100+
data=body,
101101
headers=self.build_headers(timestamp, body),
102102
)
103103
assert response.status_code == 200
@@ -143,7 +143,7 @@ async def endpoint(req: Request):
143143
client = TestClient(api)
144144
response = client.post(
145145
"/slack/events",
146-
content=body,
146+
data=body,
147147
headers=self.build_headers(timestamp, body),
148148
)
149149
assert response.status_code == 200
@@ -189,7 +189,7 @@ async def endpoint(req: Request):
189189
client = TestClient(api)
190190
response = client.post(
191191
"/slack/events",
192-
content=body,
192+
data=body,
193193
headers=self.build_headers(timestamp, body),
194194
)
195195
assert response.status_code == 200

tests/adapter_tests_async/test_async_fastapi.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ async def endpoint(req: Request):
9494
client = TestClient(api)
9595
response = client.post(
9696
"/slack/events",
97-
content=body,
97+
data=body,
9898
headers=self.build_headers(timestamp, body),
9999
)
100100
assert response.status_code == 200
@@ -138,7 +138,7 @@ async def endpoint(req: Request):
138138
client = TestClient(api)
139139
response = client.post(
140140
"/slack/events",
141-
content=body,
141+
data=body,
142142
headers=self.build_headers(timestamp, body),
143143
)
144144
assert response.status_code == 200
@@ -182,7 +182,7 @@ async def endpoint(req: Request):
182182
client = TestClient(api)
183183
response = client.post(
184184
"/slack/events",
185-
content=body,
185+
data=body,
186186
headers=self.build_headers(timestamp, body),
187187
)
188188
assert response.status_code == 200
@@ -255,7 +255,7 @@ async def endpoint(req: Request, foo: str = Depends(get_foo)):
255255
client = TestClient(api)
256256
response = client.post(
257257
"/slack/events",
258-
content=body,
258+
data=body,
259259
headers=self.build_headers(timestamp, body),
260260
)
261261
assert response.status_code == 200

tests/adapter_tests_async/test_async_starlette.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ async def endpoint(req: Request):
9797
client = TestClient(api)
9898
response = client.post(
9999
"/slack/events",
100-
content=body,
100+
data=body,
101101
headers=self.build_headers(timestamp, body),
102102
)
103103
assert response.status_code == 200
@@ -143,7 +143,7 @@ async def endpoint(req: Request):
143143
client = TestClient(api)
144144
response = client.post(
145145
"/slack/events",
146-
content=body,
146+
data=body,
147147
headers=self.build_headers(timestamp, body),
148148
)
149149
assert response.status_code == 200
@@ -189,7 +189,7 @@ async def endpoint(req: Request):
189189
client = TestClient(api)
190190
response = client.post(
191191
"/slack/events",
192-
content=body,
192+
data=body,
193193
headers=self.build_headers(timestamp, body),
194194
)
195195
assert response.status_code == 200

tests/scenario_tests/test_app.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
22
import time
33
from concurrent.futures import Executor
4-
import ssl
4+
from ssl import SSLContext
55

66
import pytest
77
from slack_sdk import WebClient
@@ -236,12 +236,12 @@ def test_none_body_no_middleware(self):
236236
assert response.body == '{"error": "unhandled request"}'
237237

238238
def test_proxy_ssl_for_respond(self):
239-
ssl_context = ssl.create_default_context()
239+
ssl = SSLContext()
240240
web_client = WebClient(
241241
token=self.valid_token,
242242
base_url=self.mock_api_server_base_url,
243243
proxy="http://proxy-host:9000/",
244-
ssl=ssl_context,
244+
ssl=ssl,
245245
)
246246
app = App(
247247
signing_secret="valid",
@@ -257,9 +257,9 @@ def test_proxy_ssl_for_respond(self):
257257
@app.event("app_mention")
258258
def handle(context: BoltContext, respond):
259259
assert context.respond.proxy == "http://proxy-host:9000/"
260-
assert context.respond.ssl == ssl_context
260+
assert context.respond.ssl == ssl
261261
assert respond.proxy == "http://proxy-host:9000/"
262-
assert respond.ssl == ssl_context
262+
assert respond.ssl == ssl
263263
result["called"] = True
264264

265265
req = BoltRequest(body=app_mention_event_body, headers={}, mode="socket_mode")

tests/scenario_tests/test_lazy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ def async2(context, say):
156156

157157
@app.middleware
158158
def set_ssl_context(context, next_):
159-
import ssl
159+
from ssl import SSLContext
160160

161161
context["foo"] = "FOO"
162162
# This causes an error when starting lazy listener executions
163-
context["ssl_context"] = ssl.create_default_context()
163+
context["ssl_context"] = SSLContext()
164164
next_()
165165

166166
# 2021-12-13 11:14:29 ERROR Failed to run a middleware middleware (error: cannot pickle 'SSLContext' object)

tests/scenario_tests_async/test_app.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import asyncio
22
import logging
3-
import ssl
3+
from ssl import SSLContext
44

55
import pytest
66
from slack_sdk import WebClient
@@ -185,14 +185,14 @@ def test_installation_store_conflicts(self):
185185

186186
@pytest.mark.asyncio
187187
async def test_proxy_ssl_for_respond(self):
188-
ssl_ctx = ssl.create_default_context()
188+
ssl = SSLContext()
189189
app = AsyncApp(
190190
signing_secret="valid",
191191
client=AsyncWebClient(
192192
token=self.valid_token,
193193
base_url=self.mock_api_server_base_url,
194194
proxy="http://proxy-host:9000/",
195-
ssl=ssl_ctx,
195+
ssl=ssl,
196196
),
197197
authorize=my_authorize,
198198
)
@@ -202,9 +202,9 @@ async def test_proxy_ssl_for_respond(self):
202202
@app.event("app_mention")
203203
async def handle(context: AsyncBoltContext, respond):
204204
assert context.respond.proxy == "http://proxy-host:9000/"
205-
assert context.respond.ssl == ssl_ctx
205+
assert context.respond.ssl == ssl
206206
assert respond.proxy == "http://proxy-host:9000/"
207-
assert respond.ssl == ssl_ctx
207+
assert respond.ssl == ssl
208208
result["called"] = True
209209

210210
req = AsyncBoltRequest(body=app_mention_event_body, headers={}, mode="socket_mode")

tests/scenario_tests_async/test_lazy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ async def async2(context, say):
138138

139139
@app.middleware
140140
async def set_ssl_context(context, next_):
141-
import ssl
141+
from ssl import SSLContext
142142

143143
context["foo"] = "FOO"
144144
# This causes an error when starting lazy listener executions
145-
context["ssl_context"] = ssl.create_default_context()
145+
context["ssl_context"] = SSLContext()
146146
await next_()
147147

148148
# 2021-12-13 11:52:46 ERROR Failed to run a middleware function (error: cannot pickle 'SSLContext' object)

0 commit comments

Comments
 (0)