Python3 Lettuce抛出SyntaxError

Pan*_*ani 4 pip python-3.x lettuce

我想用生菜写一些简单的单元测试.
(更具体地说,我正在遵循本教程:https://semaphoreci.com/community/tutorials/bdd-testing-a-restful-web-application-in-python)
我刚安装了生菜:

$ pip3 install lettuce
Run Code Online (Sandbox Code Playgroud)

当我跑

$ lettuce test/features 
Run Code Online (Sandbox Code Playgroud)

我明白了:

Traceback (most recent call last):
  File "/usr/local/bin/lettuce", line 9, in <module>
    load_entry_point('lettuce==0.2.23', 'console_scripts', 'lettuce')()
  File "/usr/local/lib/python3.4/site-packages/pkg_resources/__init__.py", line 542, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2569, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2229, in load
    return self.resolve()
  File "/usr/local/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2235, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python3.4/site-packages/lettuce/__init__.py", line 179
    print "Error loading step definitions:\n", e
                                        ^
SyntaxError: Missing parentheses in call to 'print'
Run Code Online (Sandbox Code Playgroud)

莴苣包里有错吗?我去纠正了一些事情(为一些打印语句添加了括号,然后由于同样的原因,其他一些打印失败).有任何想法吗?

Mar*_*ers 8

不幸的是,lettuce与Python 3不兼容.

该项目没有任何地方说明他们兼容的,但他们的源代码是用Python 2条特定语句,如print引发异常的语句.然而,有更多的问题不仅如此print.有一个问题需要Python 3支持.

如果必须使用,lettuce则需要使用Python 2.7.否则,似乎有一个与Python 3 aloe兼容的分支nose.