简体   繁体   English

使用行为,在Pycharm Professional 2019.1中“未找到测试”

[英]“No Tests were found” in Pycharm Professional 2019.1 using Behave

Starting Python BDD, using Behave in pycharm 2019.1 pro. 在pycharm 2019.1 pro中使用Behave启动Python BDD。 Just started learning Python and Pycharm IDE. 刚刚开始学习Python和Pycharm IDE。

Used a basic example to run a feature file with one scenario in it. 使用一个基本示例来运行其中包含一个场景的功能文件。 When I run using Pycharm Terminal, the scenario runs fine. 当我使用Pycharm Terminal运行时,该方案运行良好。 When I do the same while right clicking on the Scenario in the editor, I get the message at run time, "No tests were found". 当我在编辑器中的“场景”上单击鼠标右键时,我在运行时收到以下消息:“未找到测试”。

I have searched on SO but responses are for unit tests not for BDD tests. 我已经搜索过SO,但是响应是针对单元测试的,而不是针对BDD测试的。

I went into the run/debug configuration and have tried setup working directory to my feature folder or the project folder, but still the same issue. 我进入运行/调试配置,并尝试在我的功能文件夹或项目文件夹中设置工作目录,但仍然存在相同的问题。

I previously had python 3.7 but now using python 3.6 (both installed) and the interpreter is set to behave 我以前有python 3.7,但现在使用python 3.6(都安装了),并且解释器设置为行为正常

I got it working but uninstalling pycharm, python 3.6 and python 3.7 folders completely (includuing hidden folders from private @ root) from my machine, fresh install pycharm with python 3.6 and then behave. 我可以正常工作,但是要从我的机器上完全卸载pycharm,python 3.6和python 3.7文件夹(包括来自private @ root的隐藏文件夹),然后使用python 3.6重新安装pycharm,然后再执行操作。 Tests work now. 测试现在可以进行。

No idea exactly why it happened except that it could be some conflicting config due to different python versions. 除了由于不同的python版本而可能是一些冲突的配置之外,不知道它为什么会发生。

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

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