Skip to content
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

Remove deprecated encoding parameter for Python 3.9 compatibility. #5174

Merged
merged 1 commit into from
Jan 23, 2020
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
13 changes: 6 additions & 7 deletions notebook/tests/test_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def test_gateway_get_kernelspecs(self):
with mocked_gateway:
response = self.request('GET', '/api/kernelspecs')
self.assertEqual(response.status_code, 200)
content = json.loads(response.content.decode('utf-8'), encoding='utf-8')
content = json.loads(response.content.decode('utf-8'))
kspecs = content.get('kernelspecs')
self.assertEqual(len(kspecs), 2)
self.assertEqual(kspecs.get('kspec_bar').get('name'), 'kspec_bar')
Expand All @@ -186,7 +186,7 @@ def test_gateway_get_named_kernelspec(self):
with mocked_gateway:
response = self.request('GET', '/api/kernelspecs/kspec_foo')
self.assertEqual(response.status_code, 200)
kspec_foo = json.loads(response.content.decode('utf-8'), encoding='utf-8')
kspec_foo = json.loads(response.content.decode('utf-8'))
self.assertEqual(kspec_foo.get('name'), 'kspec_foo')

response = self.request('GET', '/api/kernelspecs/no_such_spec')
Expand Down Expand Up @@ -257,7 +257,7 @@ def create_session(self, kernel_name):
# Create the kernel... (also tests get_kernel)
response = self.request('POST', '/api/sessions', **kwargs)
self.assertEqual(response.status_code, 201)
model = json.loads(response.content.decode('utf-8'), encoding='utf-8')
model = json.loads(response.content.decode('utf-8'))
self.assertEqual(model.get('path'), nb_path)
kernel_id = model.get('kernel').get('id')
# ensure its in the running_kernels and name matches.
Expand Down Expand Up @@ -286,7 +286,7 @@ def is_kernel_running(self, kernel_id):
# Get list of running kernels
response = self.request('GET', '/api/kernels')
self.assertEqual(response.status_code, 200)
kernels = json.loads(response.content.decode('utf-8'), encoding='utf-8')
kernels = json.loads(response.content.decode('utf-8'))
self.assertEqual(len(kernels), len(running_kernels))
for model in kernels:
if model.get('id') == kernel_id:
Expand All @@ -305,7 +305,7 @@ def create_kernel(self, kernel_name):

response = self.request('POST', '/api/kernels', **kwargs)
self.assertEqual(response.status_code, 201)
model = json.loads(response.content.decode('utf-8'), encoding='utf-8')
model = json.loads(response.content.decode('utf-8'))
kernel_id = model.get('id')
# ensure its in the running_kernels and name matches.
running_kernel = running_kernels.get(kernel_id)
Expand All @@ -330,7 +330,7 @@ def restart_kernel(self, kernel_id):
with mocked_gateway:
response = self.request('POST', '/api/kernels/' + kernel_id + '/restart')
self.assertEqual(response.status_code, 200)
model = json.loads(response.content.decode('utf-8'), encoding='utf-8')
model = json.loads(response.content.decode('utf-8'))
restarted_kernel_id = model.get('id')
# ensure its in the running_kernels and name matches.
running_kernel = running_kernels.get(restarted_kernel_id)
Expand All @@ -345,4 +345,3 @@ def delete_kernel(self, kernel_id):
response = self.request('DELETE', '/api/kernels/' + kernel_id)
self.assertEqual(response.status_code, 204)
self.assertEqual(response.reason, 'No Content')