从存储库中提取功能和依赖性?
上下文
假设一个名为some_repo
的存储库文件夹,带有名为test_something.py.py
in Directory some_repo/tests/tests/code>的test文件,其中包含一个名为nast的测试类
class test_something(Unittest.testcase):
具有名为:def test_four(self)的测试:
。此test_four(self)
从存储库中的其他一些文件调用了很多功能。
问题
是可以从repo a
中复制最小文件,函数和类,这些文件,是运行test_four(self)
从test_something中运行
文件,从repository test_four(self)
。 pya
用一个命令到另一个文件夹 b ?
类比
有点像在衣服的衣服上拉一个线,并在没有其余衣服的情况下拿起整件衣服。
方法是
我的第一个猜测是删除所有其他测试文件,而__ Main __。py
文件并运行秃鹰,但是,这似乎有些令人费解,在我的经验中,秃鹰通常需要一些人类的指导。
Context
Suppose one a repository folder named some_repo
, with a test file named test_something.py
in directory some_repo/tests/
which contains a test class named class Test_something(unittest.TestCase):
which has a test named: def test_four(self):
. This test_four(self)
calls quite a few functions from a few other files in the repository.
Question
Is it possible to copy the minimum amount of files, functions and classes from repo a
that are required to run the test_four(self)
test from the test_something.py
file, from repository a
into another folder b
with a single command?
Analogy
Kind of like pulling a single thread in a clothing outfit, and getting that entire piece of clothing, without the rest of the outfit.
Approach
My first guess would be to remove all other test files, and the __main__.py
file and to run Vulture, however, that seems slightly convoluted, and in my experience Vulture often needs some human guidance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论