简体   繁体   English

生菜的Python示例给出控制台错误?

[英]Lettuce for Python example gives console error?

Trying to run the simple lettuce tests scenario (from here ). 尝试运行简单的生菜测试场景(从此处开始 )。 I get these: 我得到这些:

Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\lettuce-0.2.19-py2.7.egg\lettuce\registry.py", line 88, in call_hook
    callback(*args, **kw)
  File "C:\Python27\lib\site-packages\lettuce-0.2.19-py2.7.egg\lettuce\plugins\colored_shell_output.py", line 91, in pri
nt_step_ran
    width, height = terminal.get_size()
  File "C:\Python27\lib\site-packages\lettuce-0.2.19-py2.7.egg\lettuce\terminal.py", line 24, in get_size
    size = get_terminal_size_win()
  File "C:\Python27\lib\site-packages\lettuce-0.2.19-py2.7.egg\lettuce\terminal.py", line 43, in get_terminal_size_win
    res = windll.kernel32.GetConsoleScreenBufferInfo(h, csbi)
ArgumentError: argument 2: <type 'exceptions.TypeError'>: expected LP_CONSOLE_SCREEN_BUFFER_INFO instance instead of c_c
har_Array_22

Died with argument 2: <type 'exceptions.TypeError'>: expected LP_CONSOLE_SCREEN_BUFFER_INFO instance instead of c_char_A
rray_22
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\lettuce-0.2.19-py2.7.egg\lettuce\__init__.py", line 164, in run
    failfast=self.failfast))
  File "C:\Python27\lib\site-packages\lettuce-0.2.19-py2.7.egg\lettuce\core.py", line 1186, in run
    scenarios_ran.extend(scenario.run(ignore_case, failfast=failfast))
  File "C:\Python27\lib\site-packages\lettuce-0.2.19-py2.7.egg\lettuce\core.py", line 726, in run
    results.append(run_scenario(self, run_callbacks=True))
  File "C:\Python27\lib\site-packages\lettuce-0.2.19-py2.7.egg\lettuce\core.py", line 699, in run_scenario
    all_steps, steps_passed, steps_failed, steps_undefined, reasons_to_fail = Step.run_all(self.steps, outline, run_call
backs, ignore_case, failfast=failfast)
  File "C:\Python27\lib\site-packages\lettuce-0.2.19-py2.7.egg\lettuce\core.py", line 472, in run_all
    call_hook('after_each', 'step', step)
  File "C:\Python27\lib\site-packages\lettuce-0.2.19-py2.7.egg\lettuce\registry.py", line 88, in call_hook
    callback(*args, **kw)
  File "C:\Python27\lib\site-packages\lettuce-0.2.19-py2.7.egg\lettuce\plugins\colored_shell_output.py", line 91, in pri
nt_step_ran
    width, height = terminal.get_size()
  File "C:\Python27\lib\site-packages\lettuce-0.2.19-py2.7.egg\lettuce\terminal.py", line 24, in get_size
    size = get_terminal_size_win()
  File "C:\Python27\lib\site-packages\lettuce-0.2.19-py2.7.egg\lettuce\terminal.py", line 43, in get_terminal_size_win
    res = windll.kernel32.GetConsoleScreenBufferInfo(h, csbi)
ArgumentError: argument 2: <type 'exceptions.TypeError'>: expected LP_CONSOLE_SCREEN_BUFFER_INFO instance instead of c_c
har_Array_22

Am I missing some configuration tricks? 我是否缺少一些配置技巧?

lettuce -v [x]

where x can be 1, 2 or 3 and specifies the amount of detail shown about the run. 其中x可以是1, 2 or 3并指定显示的有关运行的详细信息量。

Found the hint here http://www.erlisvidal.com/2010/10/how-install-lettuce-windows.html 在此处找到提示http://www.erlisvidal.com/2010/10/how-install-lettuce-windows.html

windows haven't fcntl model. Windows还没有fcntl模型。 Edit the file init .py located in c:\\Python27\\Lib\\site-packages\\lettuce-0.1.20-py2.7.egg\\lettuce__init__.py "In that file locate the line that contains" in my machine this line appears in line 121 . 编辑位于c:\\ Python27 \\ Lib \\ site-packages \\ lettuce-0.1.20-py2.7.egg \\ lettuce__init __。py中的文件init .py“在我的机器中,找到包含该行的行”在121行。 you can replace that line with the line: from lettuce.plugins import shell_output as output 您可以将该行替换为:from lettuce.plugins import shell_output作为输出

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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