Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

Commit

Permalink
fix mock py2/3 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
paiweilai committed Aug 30, 2016
1 parent ce3e38b commit dc32d5c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/pattern/util_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from __future__ import division
from __future__ import print_function

import sys

import mock
from pyparsing import Keyword

Expand All @@ -14,7 +16,13 @@
from undebt.pattern.util import trailing_whitespace


@mock.patch('__builtin__.print')
if sys.version_info.major == 3:
builtin_module_name = 'builtins'
else:
builtin_module_name = '__builtin__'


@mock.patch('{}.print'.format(builtin_module_name))
def test_debug(mock_print):
assert_parse(
grammar=debug(Keyword('something')),
Expand Down

0 comments on commit dc32d5c

Please sign in to comment.