为什么nose会在只有644权限的文件中找到测试?

发布于 2024-08-23 23:12:10 字数 447 浏览 3 评论 0原文

今天,我使用 Python 2.6 在 Ubuntu 9.10 上用鼻子运行了一堆文档测试:

nosetests --with-doctest
Ran 0 tests in 0.001s

OK

WTF?我在该文件中进行了测试,为什么不起作用?

我将权限更改为 644:

sudo chmod 644 * -R
nosetests --with-doctest
Ran 11 test in 0.004s

FAILED (errors=1)

将其更改回 777:

sudo chmod 777 * -R
nosetests --with-doctest
Ran 0 tests in 0.001s

OK

这是为什么?使用 644,我什至无法编辑我的文件!

Today I ran a bunch of doctests using Python 2.6 on a Ubuntu 9.10 with nose :

nosetests --with-doctest
Ran 0 tests in 0.001s

OK

WTF? I had tests in that files, why didn't that work?

I changed permission to 644:

sudo chmod 644 * -R
nosetests --with-doctest
Ran 11 test in 0.004s

FAILED (errors=1)

Changing it back to 777:

sudo chmod 777 * -R
nosetests --with-doctest
Ran 0 tests in 0.001s

OK

Why is that? Using 644, I can't even edit my files!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不…忘初心 2024-08-30 23:12:10

尝试使用 --exe 标志:

$ nosetests --help

...    

--exe               Look for tests in python modules that are executable.
                    Normal behavior is to exclude executable modules,
                    since they may not be import-safe [NOSE_INCLUDE_EXE]

Try the --exe flag:

$ nosetests --help

...    

--exe               Look for tests in python modules that are executable.
                    Normal behavior is to exclude executable modules,
                    since they may not be import-safe [NOSE_INCLUDE_EXE]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文