我正在尝试定义另一个测试运行程序。
为此,我更改了settings.py
:
TEST_RUNNER = 'test_runner.MezzoTestsRunner'
这是我的MezzoTestsRunner
类:
class MezzoTestsRunner(DiscoverRunner):
def __init__(self):
super(MezzoTestsRunner,self).__init__(keepdb=True)
然后我使用命令:python manage.py test
File "manage.py", line 29, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 345, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/test.py", line 30, in run_from_argv
super(Command, self).run_from_argv(argv)
File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/test.py", line 74, in execute
super(Command, self).execute(*args, **options)
File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 399, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/test.py", line 89, in handle
test_runner = TestRunner(**options)
TypeError: __init__() got an unexpected keyword argument 'verbosity'
我真的很惊讶有这个结果。。有人已经有同样的经历了吗?你知道吗
谢谢:)
PS:我用的是django1.9
我没有真正解决我的问题,但我可以逃避这个问题。 我无法在
__init__()
中更改keepdb
,因此我在run_tests()
方法中更改了它:相关问题 更多 >
编程相关推荐