fixed encoding issue in python 3.3-3.5
Browse files- tests/conftest.py +4 -2
tests/conftest.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
# -*- coding: utf-8 -*-
|
2 |
"""Reusable dependency injected testing components."""
|
|
|
|
|
3 |
import gzip
|
4 |
import json
|
5 |
import os
|
@@ -13,8 +15,8 @@ def load_from_playback_file(filename):
|
|
13 |
cur_dir = os.path.dirname(os.path.realpath(__file__))
|
14 |
fp = os.path.join(cur_dir, 'mocks', filename)
|
15 |
video = None
|
16 |
-
with gzip.open(fp, '
|
17 |
-
video = json.loads(fh.read())
|
18 |
yt = YouTube(
|
19 |
url='https://www.youtube.com/watch?v=9bZkp7q19f0',
|
20 |
defer_prefetch_init=True,
|
|
|
1 |
# -*- coding: utf-8 -*-
|
2 |
"""Reusable dependency injected testing components."""
|
3 |
+
from __future__ import unicode_literals
|
4 |
+
|
5 |
import gzip
|
6 |
import json
|
7 |
import os
|
|
|
15 |
cur_dir = os.path.dirname(os.path.realpath(__file__))
|
16 |
fp = os.path.join(cur_dir, 'mocks', filename)
|
17 |
video = None
|
18 |
+
with gzip.open(fp, 'rb') as fh:
|
19 |
+
video = json.loads(fh.read().decode('utf-8'))
|
20 |
yt = YouTube(
|
21 |
url='https://www.youtube.com/watch?v=9bZkp7q19f0',
|
22 |
defer_prefetch_init=True,
|