有没有一种简单的方法可以在Django中使用秃ul?

编程入门 行业动态 更新时间:2024-10-22 05:13:47
本文介绍了有没有一种简单的方法可以在Django中使用秃ul?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试清理django中一些复杂的旧代码。 秃鹰看起来不错,但它似乎不知道如何找到引用的视图函数来自urls.py。这并不奇怪,因为大多数函数都包含为字符串:

I'm trying to clean up some tangled legacy code in django. Vulture looks like a good bet, but it doesn't seem to know how to find view functions referenced from urls.py. This isn't too surprising, since most of the functions are included as strings:

... url(r'^some-url/$', 'my_app.views.some_url_view'), ...

有没有一种简单的方法可以让秃鹰了解视图功能?

Is there a simple way to make vulture aware of the view functions?

我要为我做的一件事:我写的内容相当广泛测试代码。目前,秃鹰错过了这些测试,但是如果有某种方法可以让秃鹰了解这些测试,那么我认为所有的观点也将包括在内。

One thing I've got going for me: I've written fairly extensive tests for the code. Currently, vulture misses these tests, but if there were some way to make vulture aware of these tests, I think all the views would be included as well.

推荐答案

尝试Ned的Batchelder coverage 本身或与 一起使用鼻子 。

Try Ned's Batchelder coverage by itself or use it with nose.

只需运行测试用例, coverage html 就会为您提供漂亮的报告,逐行显示您的代码,详细的覆盖范围信息。然后整理/删除未使用/未使用的代码。

Just run through the testcases, and coverage html will get you a beautiful reporting showing your code line by line, with detailed coverage information. Trim down/remove unused/untested code afterwards.

更多推荐

有没有一种简单的方法可以在Django中使用秃ul?

本文发布于:2023-05-28 06:54:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/315102.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:词库加载错误:Could not find file 'D:\淘小白 高铁采集器win10\Configuration\Dict_Sto

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!