Skip to content

Commit be567ca

Browse files
committed
decode json models on 3.5
1 parent ed413b8 commit be567ca

File tree

12 files changed

+101
-100
lines changed

12 files changed

+101
-100
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ script:
3737
else
3838
true
3939
fi
40-
- 'if [[ $GROUP == python ]]; then pytest jupyter_server; fi'
40+
- 'if [[ $GROUP == python ]]; then pytest; fi'
4141
- |
4242
if [[ $GROUP == docs ]]; then
4343
EXIT_STATUS=0

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ install:
2525
- cmd: pip install .[test]
2626

2727
test_script:
28-
- pytest jupyter_server
28+
- pytest

tests/conftest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def expected_http_error(error, expected_code, expected_message=None):
4242
if expected_code != e.code:
4343
return False
4444
if expected_message:
45-
message = json.loads(e.response.body)['message']
45+
message = json.loads(e.response.body.decode())['message']
4646
if expected_message != message:
4747
return False
4848
return True
@@ -72,10 +72,10 @@ def environ(
7272
monkeypatch.setenv('JUPYTER_CONFIG_DIR', str(config_dir))
7373
monkeypatch.setenv('JUPYTER_DATA_DIR', str(data_dir))
7474
monkeypatch.setenv('JUPYTER_RUNTIME_DIR', str(runtime_dir))
75-
monkeypatch.setattr(jupyter_core.paths, 'SYSTEM_JUPYTER_PATH', [mkdir(tmp_path, 'share', 'jupyter')])
76-
monkeypatch.setattr(jupyter_core.paths, 'ENV_JUPYTER_PATH', [mkdir(tmp_path, 'env', 'share', 'jupyter')])
77-
monkeypatch.setattr(jupyter_core.paths, 'SYSTEM_CONFIG_PATH', [mkdir(tmp_path, 'etc', 'jupyter')])
78-
monkeypatch.setattr(jupyter_core.paths, 'ENV_CONFIG_PATH', [mkdir(tmp_path, 'env', 'etc', 'jupyter')])
75+
monkeypatch.setattr(jupyter_core.paths, 'SYSTEM_JUPYTER_PATH', [str(mkdir(tmp_path, 'share', 'jupyter'))])
76+
monkeypatch.setattr(jupyter_core.paths, 'ENV_JUPYTER_PATH', [str(mkdir(tmp_path, 'env', 'share', 'jupyter'))])
77+
monkeypatch.setattr(jupyter_core.paths, 'SYSTEM_CONFIG_PATH', [str(mkdir(tmp_path, 'etc', 'jupyter'))])
78+
monkeypatch.setattr(jupyter_core.paths, 'ENV_CONFIG_PATH', [str(mkdir(tmp_path, 'env', 'etc', 'jupyter'))])
7979

8080

8181
@pytest.fixture

tests/nbconvert/test_handlers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ async def test_from_post(fetch, notebook):
114114
'api/contents/foo/testnb.ipynb',
115115
method='GET',
116116
)
117-
nbmodel = json.loads(r.body)
117+
nbmodel = json.loads(r.body.decode())
118118

119119
r = await fetch(
120120
'nbconvert', 'html',
@@ -142,7 +142,7 @@ async def test_from_post_zip(fetch, notebook):
142142
'api/contents/foo/testnb.ipynb',
143143
method='GET',
144144
)
145-
nbmodel = json.loads(r.body)
145+
nbmodel = json.loads(r.body.decode())
146146

147147
r = await fetch(
148148
'nbconvert', 'latex',

tests/services/config/test_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async def test_create_retrieve_config(fetch):
1818
method='GET',
1919
)
2020
assert response2.code == 200
21-
assert json.loads(response2.body) == sample
21+
assert json.loads(response2.body.decode()) == sample
2222

2323

2424
async def test_modify(fetch):
@@ -56,7 +56,7 @@ async def test_modify(fetch):
5656
)
5757

5858
assert response2.code == 200
59-
assert json.loads(response2.body) == diff
59+
assert json.loads(response2.body.decode()) == diff
6060

6161

6262
async def test_get_unknown(fetch):
@@ -65,4 +65,4 @@ async def test_get_unknown(fetch):
6565
method='GET',
6666
)
6767
assert response.code == 200
68-
assert json.loads(response.body) == {}
68+
assert json.loads(response.body.decode()) == {}

0 commit comments

Comments
 (0)