在看python的_python – 如何查看在Django的manage.py test命令中运行的测试

您可以将-v 2传递给测试命令:

python manage.py test -v 2

运行这个命令后,你会得到这样的东西(我使用django 1.9,随意忽略迁移/数据库的东西):

Creating test database for alias 'default' (':memory:')...

Operations to perform:

Synchronize unmigrated apps: staticfiles, messages

Apply all migrations: admin, contenttypes, auth, sessions

Synchronizing apps without migrations:

Creating tables...

Running deferred SQL...

Running migrations:

Rendering model states... DONE

Applying contenttypes.0001_initial... OK

Applying auth.0001_initial... OK

Applying admin.0001_initial... OK

Applying admin.0002_logentry_remove_auto_add... OK

Applying contenttypes.0002_remove_content_type_name... OK

Applying auth.0002_alter_permission_name_max_length... OK

Applying auth.0003_alter_user_email_max_length... OK

Applying auth.0004_alter_user_username_opts... OK

Applying auth.0005_alter_user_last_login_null... OK

Applying auth.0006_require_contenttypes_0002... OK

Applying auth.0007_alter_validators_add_error_messages... OK

Applying sessions.0001_initial... OK

test_equal_hard (polls.tests.TestHard) ... ok

test_equal_simple (polls.tests.TestSimple) ... ok

|

|

That's your tests! >----------------------------+

顺便说一下,v代表verbosity(你也可以使用–verbosity = 2):

python manage.py test --verbosity=2

这里是从python manage.py –help摘录:

Options: -v VERBOSITY, –verbosity=VERBOSITY

Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very verbose output

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值