简体   繁体   English

pycharm 运行单元测试停止工作

[英]pycharm running unittests stopped working

For some unknown reason my pycharm has stopped successfully running unittests.由于某些未知原因,我的 pycharm 已停止成功运行单元测试。 Before I could simply right click a file of tests and hit Debug unittests in.. or in the file itself call for debugging on the TestCase subclass itself or on any test_ method thereof.在我可以简单地右键单击测试文件并点击 Debug unittests in.. 或文件本身之前,需要对 TestCase 子类本身或其任何 test_ 方法进行调试。 Now it just finishes immediately with nothing and creates an artifact in configurations that seems to be treating the unitest file as a simple python file.现在它只是立即完成,并在配置中创建一个工件,似乎将 unitest 文件视为简单的 python 文件。 If I delete that I sometimes get in a weird state where it fails a bunch of assertions immediately and tries to user my path to the file as a module somehow by the error it puts out.如果我删除它,我有时会遇到一个奇怪的 state ,它会立即使一堆断言失败,并尝试通过它发出的错误以某种方式将我的文件路径作为模块使用。

I don't understand.我不明白。 I have used pycharm for years and never seen this problem previously.我已经使用 pycharm 多年,以前从未见过这个问题。

Looks to be the 2019.2 version running on Ubuntu.看起来是在 Ubuntu 上运行的 2019.2 版本。 Did something change?有什么改变吗?

Ah ha.啊哈。 The project having the problem was opened via a soft link directory.有问题的项目是通过软链接目录打开的。 When I opened the same thing using the direct directory the problem disappeared.当我使用直接目录打开相同的东西时,问题就消失了。 Bizarre.奇怪。

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

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