python / python/cpython

Add tests for setting and deleting attributes defined in C

オープン
#156,106 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

tests
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

CPython defines 375 attributes with PyMemberDef and PyGetSetDef (excluding the _test* modules), but the test suite never assigns to 187 of them and never deletes 332 of them.

Deletion in particular is almost untested, although it is a separate code path: the setter is called with NULL, and an implementation which does not expect this crashes or leaves the object in a broken state.

Three bugs found this way are gh-156099, gh-156100 and gh-156101; gh-152817 is another one.

The following PR adds writing and deleting tests for each writable attribute.

Linked PRs
  • gh-156107
  • gh-156184
  • gh-156191

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、PyMemberDef と PyGetSetDef で定義された属性に対する CPython のテストカバレッジを見つけます。書き込み可能な属性が現在どのように代入・削除されているかを確認し、報告されている不足箇所と既存のテストを使って、各書き込み可能な属性をカバーします。すべての書き込み可能な属性について、クラッシュや壊れたオブジェクトなしに代入と削除がテストされれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c, python
領域
testing-qa
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
20/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。