8000 Fix `mock` import for python3 · yan-code1/ffmpeg-python@e5e293f · GitHub
[go: up one dir, main page]

Skip to content

Commit e5e293f

Browse files
committed
Fix mock import for python3
1 parent 462e34b commit e5e293f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ffmpeg/tests/test_ffmpeg.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
from builtins import range
44
from builtins import str
55
import ffmpeg
6-
import mock
76
import os
87
import pytest
98
import random
109
import re
1110
import subprocess
1211

12+
try:
13+
import mock # python 2
14+
except ImportError:
15+
from unittest import mock # python 3
16+
1317

1418
TEST_DIR = os.path.dirname(__file__)
1519
SAMPLE_DATA_DIR = os.path.join(TEST_DIR, 'sample_data')

0 commit comments

Comments
 (0)
0