【问题标题】:Import all doesnot work全部导入不起作用
【发布时间】:2013-08-22 06:30:43
【问题描述】:

我正在尝试在Eclipse 中使用Behave 构建BDD 测试环境。每当我从 import 定义开始时,from behave import * Eclipse 就会引发 import 警告。

另外,given、when 和 then 的装饰器标记为 undefined variables。

有人知道为什么decorators 没有被导入吗?

使用from behave import *时的错误信息

Unused in wild import: AmbiguousStep, StepRegistry, i18n, importer, json_parser, log_capture, matchers, model, names, runner, runner_util, setup_step_decorators, step_matcher, step_registry, tag_expression, textutil... others suppressed

装饰器的错误信息:

Undefined variable: given

【问题讨论】:

  • 你能添加你的错误信息吗?
  • 添加了错误信息
  • "Unused in wild import" 是一个警告 ;-) 尝试显式导入:例如从给定的行为导入,然后,步骤Some hints about behave

标签: python eclipse import bdd


【解决方案1】:

先做:

import explicit

然后:

from behave import given, when, then, step

如果不添加评论,那应该可以:)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-27
    • 1970-01-01
    • 1970-01-01
    • 2021-12-31
    • 1970-01-01
    • 2014-12-27
    相关资源
    最近更新 更多