这对我来说非常奇怪,事情一直很好,直到今天早上.
当我尝试使用以下代码运行我的单元测试时(我将Python3软件链接到python)
clear; python manage.py test list tests/
我现在收到以下错误消息:
Traceback (most recent call last):
File "manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/usr/lib/python3.4/site-packages/django/core/management /__init__.py", line 385, in execute_from_command_line
utility.execute()
File "/usr/lib/python3.4/site-packages/django/core/management /__init__.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python3.4/site-packages/django/core/management/commands /test.py", line 50, in run_from_argv
super(Command, self).run_from_argv(argv)
File "/usr/lib/python3.4/site-packages/django/core/management /base.py", line 288, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/lib/python3.4/site-packages/django/core/management/commands /test.py", line 71, in execute
super(Command, self).execute(*args, **options)
File "/usr/lib/python3.4/site-packages/django/core/management /base.py", line 338, in execute
output = self.handle(*args, **options)
File "/usr/lib/python3.4/site-packages/django/core/management/commands /test.py", line 88, in handle
failures = test_runner.run_tests(test_labels)
File "/usr/lib/python3.4/site-packages/django/test/runner.py", line 146, in run_tests
suite = self.build_suite(test_labels, extra_tests)
File "/usr/lib/python3.4/site-packages/django/test/runner.py", line 101, in build_suite
suite.addTests(tests)
File "/usr/lib64/python3.4/unittest/suite.py", line 60, in addTests
for test in tests:
TypeError: 'NoneType' object is not iterable
我最初认为我写的东西完全搞砸了所有东西,所以我把它保存为一个分支,在主分支中恢复到我某些工作的提交但我得到完全相同的错误消息.
我无法想到我做了什么让事情失败了,事实上,上面并没有指出我所写的任何东西(在我的情况下,我对Python / Django来说相对较新)正在制作它我很难调试错误.
我能想到的唯一改变的是我安装的The Silver Searcher(我使用的是vim),我删除了它仍然会发生同样的错误.
我重新安装了django,但仍无济于事.
这是:
> OpenSuse 13.2
> Django 1.7
> Python 3.4.1
有人可以帮助我吗?
>调试此错误的原因(以便我不会再次陷入其中)
>如何解决这个问题?
谢谢