启动配置first_behave.feature引用不存在的项目python_behave_template-master错误

时间:2017-07-15 09:26:20

标签: python eclipse pydev python-behave

我在eclipse中配置了Pydev,并安装了behave和cucumber来运行BDD方法的示例项目。

每当我右键单击特征文件(dirst_behave.feature)并运行为“黄瓜特征”时,我都会收到错误 -

“启动配置first_behave.feature引用不存在的项目python_behave_template-master。”

我尝试重新映射Python解释器,但没有运气。我们非常感谢您解决此问题的任何帮助。

我使用Pycharm IDE来运行python脚本,但是在Pycharm社区版本中,Behave方法不起作用。(附上屏幕截图供参考)

enter image description here

2 个答案:

答案 0 :(得分:0)

  

每当我右键单击要素文件(dirst_behave.feature)并运行为" Cucumber功能"时,我都会收到错误 -

     

"启动配置first_behave.feature引用不存在的项目python_behave_template-master。"

     

我使用Pycharm IDE来运行python脚本,但是Behave方法在Pycharm社区版本中不起作用。(附上截图供参考)

您无法直接从Pycharm IDE运行 *。feature 脚本。

尝试从终端运行脚本:

create or replace function find_shift(dat in date) return varchar2
is 
dat2 date;

treshhold1 date; 
treshhold2 date; 
ret varchar2(10);
begin 
dat2:=to_date(to_char(dat, 'HH24:MI'),'HH24:MI');
treshhold1 := to_date('08:00','HH24:MI'); 
treshhold2 := to_date('19:29','HH24:MI'); 
if dat2>=treshhold1 and dat2<= treshhold2 then 
ret := 'Morning'; 
else 
ret := 'Night'; 
end if; 
return ret 
end;

答案 1 :(得分:0)

Behave在Eclipse和PyCharm(CE)中都有效。但是还有更方便的工作。两个IDE都允许您运行通用命令。因此,应该可以运行它。当您需要调试器来诊断行为测试运行时,尤其需要这样做(但是您通常需要提供自己的脚本来导入与行为脚本相同的行为main()函数)。