Skip to content

Commit

Permalink
Use mock on py27, builtin mock on py33+.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbr committed Sep 23, 2015
1 parent 6371dc8 commit a779425
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions tests/_compat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import sys

PY2 = sys.version_info[0] == 2

if PY2:
import mock
else:
from unittest import mock
2 changes: 1 addition & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

import pytest
from mock import Mock
from _compat.mock import Mock

from tinyrpc.exc import RPCError
from tinyrpc.client import RPCClient, RPCProxy
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dispatch.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from mock import Mock, MagicMock
from _compat.mock import Mock, MagicMock
import pytest

from tinyrpc.dispatch import RPCDispatcher, public
Expand Down

0 comments on commit a779425

Please sign in to comment.