Split up _testcapimodule.c

未关闭
#93,649 38 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
20/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
停滞
技术栈
c, python
领域
testing-qa

调研方向

先查看 Modules/_testcapimodule.c 以及现有的 _testmultiphase、_testimportmultiple、_testinternalcapi 和 _testbuffer 模块,然后检查 issue 中列出的相关 PR。完成的标准是:将 C-API 测试拆分为结构一致的模块,保留相关的测试覆盖率,并避免污染顶层模块的命名空间。

由索引模型根据 Issue 内容生成。

描述

tests topic-C-API type-refactor

Modules/_testcapimodule.c is a nearly-8000-line behemoth with no clear structure or organization. It is getting hard to maintain.

It also doesn't work well with testing (a) feature macros that affect Python.h and (b) module initialization, so we have additional C-API testing modules: _testmultiphase, _testimportmultiple, _testinternalcapi.
_testbuffer is already split out, but there are many other aspects of the API that would use a similar dedicated test suite.

We should split and combine these, ideally without polluting the namespace of top-level modules.

  • PR: gh-94549
  • PR: gh-94695
  • PR: gh-94702
  • PR: gh-95386
  • PR: gh-95793
  • PR: gh-95819
  • PR: gh-99346
  • PR: gh-99494
  • PR: gh-99517
  • PR: gh-99532
  • PR: gh-99549
  • PR: gh-99551
  • PR: gh-102173
  • PR: gh-104403
  • PR: gh-129400
  • PR: gh-129512
  • PR: gh-129516
  • PR: gh-129521
  • PR: gh-129544
主要语言
Python
星标
77.2k
派生
36k
平均合并
1 天 9 小时
30 天内合并 PR
558

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

python/cpython 的其他 Issue

查看 python/cpython 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。