简体   繁体   中英

python mock module throws exception

I am very new in this forum. So please let me know if I am not asking question in right format, etc.

I am basically trying to follow along documentation for mock module in python http://www.voidspace.org.uk/downloads/mock-1.0.1.pdf

But if I do the following I get an error. any help? I am using python 2.7.3

>>> from mock import Mock
>>> mock = Mock()
>>> mock.method(1, 2, 3, test=’wow’)
  File "<stdin>", line 1
    mock.method(1, 2, 3, test=’wow’)
  SyntaxError: invalid syntax

If I do not use the KWARGS it works.

尝试使用'而不是'

mock.method(1, 2, 3, test='wow')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM