从存储库中提取功能和依赖性?

发布于 2025-02-04 09:09:02 字数 699 浏览 1 评论 0原文

上下文

假设一个名为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中运行test_four(self)。 py文件,从repository a用一个命令到另一个文件夹 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文