Skip to content

Commit

Permalink
tests: Try to use unittest.mock from the Python standard library
Browse files Browse the repository at this point in the history
Only fall back to the standalone mock module if the Python version is
too old to have it in the standard library.

Signed-off-by: Simon McVittie <smcv@debian.org>
  • Loading branch information
smcv committed Feb 23, 2021
1 parent 146cfdb commit 952b0c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mock
mock; python_version < '3.3'

coverage>=5.0; python_version == '2.7' or python_version >= '3.5'
pytest-cov>=2.7.0; python_version == '2.7' or python_version >= '3.5'
Expand Down
6 changes: 5 additions & 1 deletion tests/test_vdf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import unittest
import mock
import sys

try:
from unittest import mock
except ImportError:
import mock

try:
from StringIO import StringIO
except ImportError:
Expand Down

0 comments on commit 952b0c6

Please sign in to comment.