The pyrefly test fails
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 静か
- 技術スタック
- python
- 領域
- testing-qa
調査の方向性
まず tests/e2e/test_e2e_type_checking.py と tests/e2e/e2e_utils.py から始め、次に traceback が不足している mutant を報告している箇所の filter_mutants_with_type_checker を調べます。Python 3.12 と pyrefly を使って失敗している end-to-end テストを実行します。型チェックの実行で報告されたエラーが mutant に関連付けられ、snapshot テストが成功すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
=============================================================================================== FAILURES ===============================================================================================
______________________________________________________________________________ test_type_checking_pyrefly_result_snapshot ______________________________________________________________________________
def test_type_checking_pyrefly_result_snapshot():
> assert run_mutmut_on_project("type_checking") == snapshot(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
{
"mutants/src/type_checking/__init__.py.meta": {
"type_checking.x_hello__mutmut_1": 37,
"type_checking.x_hello__mutmut_2": 1,
"type_checking.x_hello__mutmut_3": 1,
"type_checking.x_hello__mutmut_4": 1,
"type_checking.x_a_hello_wrapper__mutmut_1": 37,
"type_checking.x_a_hello_wrapper__mutmut_2": 0,
"type_checking.xǁPersonǁset_name__mutmut_1": 37,
"type_checking.xǁPersonǁcreate__mutmut_1": 37,
"type_checking.xǁPersonǁcreate__mutmut_2": 37,
"type_checking.xǁEmployeeǁ__init____mutmut_1": 0,
"type_checking.xǁEmployeeǁ__init____mutmut_2": 0,
"type_checking.xǁEmployeeǁ__init____mutmut_3": 0,
"type_checking.xǁEmployeeǁ__init____mutmut_4": 37,
"type_checking.xǁEmployeeǁset_number__mutmut_1": 37,
"type_checking.xǁEmployeeǁnew__mutmut_1": 37,
"type_checking.xǁEmployeeǁnew__mutmut_2": 37,
"type_checking.xǁColorǁis_primary__mutmut_1": 33,
"type_checking.xǁColorǁdarken__mutmut_1": 37,
"type_checking.xǁColorǁdarken__mutmut_2": 0,
"type_checking.xǁColorǁdarken__mutmut_3": 37,
"type_checking.xǁColorǁdarken__mutmut_4": 0,
"type_checking.xǁColorǁget_next_color__mutmut_1": 37,
"type_checking.xǁColorǁget_next_color__mutmut_2": 0,
"type_checking.xǁColorǁget_next_color__mutmut_3": 37,
"type_checking.xǁColorǁget_next_color__mutmut_4": 37,
"type_checking.xǁColorǁget_next_color__mutmut_5": 0,
"type_checking.xǁColorǁget_next_color__mutmut_6": 0,
"type_checking.xǁColorǁto_index__mutmut_1": 37,
"type_checking.xǁColorǁto_index__mutmut_2": 37,
"type_checking.xǁColorǁto_index__mutmut_3": 37,
"type_checking.xǁColorǁto_index__mutmut_4": 0,
"type_checking.xǁColorǁto_index__mutmut_5": 0,
"type_checking.xǁColorǁto_index__mutmut_6": 0,
"type_checking.xǁColorǁfrom_index__mutmut_1": 0,
"type_checking.xǁColorǁfrom_index__mutmut_2": 0,
"type_checking.xǁColorǁcreate__mutmut_1": 1,
"type_checking.x_mutate_me__mutmut_1": 37,
"type_checking.x_mutate_me__mutmut_2": 37,
"type_checking.x_mutate_me__mutmut_3": 1,
"type_checking.x_mutate_me__mutmut_4": 1,
"type_checking.x_mutate_me__mutmut_5": 37,
}
}
)
tests/e2e/test_e2e_type_checking.py:7:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/e2e/e2e_utils.py:69: in run_mutmut_on_project
_run([], None)
../stage/usr/local/lib/python3.12/site-packages/mutmut/__main__.py:1031: in _run
mutants_caught_by_type_checker = filter_mutants_with_type_checker()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def filter_mutants_with_type_checker() -> dict[str, FailedTypeCheckMutant]:
with change_cwd(Path("mutants")):
errors = run_type_checker(Config.get().type_check_command)
errors_by_path = group_by_path(errors)
mutants_to_skip: dict[str, FailedTypeCheckMutant] = {}
for path, errors_of_file in errors_by_path.items():
with open(path, encoding="utf-8") as file:
source = file.read()
wrapper = cst.MetadataWrapper(cst.parse_module(source))
visitor = MutatedMethodsCollector(path)
wrapper.visit(visitor)
mutated_methods = visitor.found_mutants
for error in errors_of_file:
assert error.file_path == visitor.file
mutant = next(
(m for m in mutated_methods if m.line_number_start <= error.line_number <= m.line_number_end), None
)
if mutant is None:
> raise Exception(
f"Could not find mutant for type error {error.file_path}:{error.line_number} ({error.error_description}). \n"
"Probably, a code mutation influenced types in unexpected locations. \n"
"If your project normally has no type errors and uses mypy/pyrefly, please file an issue with steps to reproduce on github.\n"
)
E Exception: Could not find mutant for type error /usr/ports/devel/py-mutmut/work-py312/mutmut-3.6.0/e2e_projects/type_checking/mutants/src/type_checking/__init__.py:217 (Returned type `Color` is not assignable to declared return type `Self@Color`).
E Probably, a code mutation influenced types in unexpected locations.
E If your project normally has no type errors and uses mypy/pyrefly, please file an issue with steps to reproduce on github.
../stage/usr/local/lib/python3.12/site-packages/mutmut/mutation/file_mutation.py:494: Exception
----------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------
⠋ Generating mutants
also copying tests
also copying test
also copying setup.cfg
also copying pyproject.toml
src/type_checking/__init__.py
done in 157ms (1 files mutated, 0 ignored, 0 unmodified)
⠙ Filtering mutations with type checker
=========================================================================================== warnings summary ===========================================================================================
Version: 3.6.0
Python-3.12
FreeBSD 15.1 STABLE
- 主要言語
- Python
- スター
- 1.5k
- フォーク
- 185
- 平均マージ
- 1日 14時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
boxed/mutmut のほかの issue
-
Removing `not` from a parenthesized multi-line expression drops the parentheses (InvalidGeneratedSyntaxException, 3.8.0)対応中かも @jihtsan が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
`run` with a `name__mutmut_*` pattern runs the whole test suite in the clean-test check対応中かも @Ishaan400 が 16 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
-
Invalid unary plus generated in match statement対応中かも @GhostCoder6969 が 25 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
intake mcp-intake needs-ac needs-human-review priority:medium
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
Ikalus1988/MisakaNet#3848 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
521xueweihan/HelloGitHub#4105 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
igormcsouza/bookloud#54 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
aws-samples/sample-per-model-bedrock#526 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ok-oldking/ok-wuthering-waves#1802 ·
メンテナーはふだん 2 日以内に返信