[py] consequences of allowing snapshots based on repr
還沒有人認領這個 Issue。
評估
研究方向
此 issue 討論使用 repr() 的內嵌快照,以及使用 eval() 讀取值的磁碟快照,但沒有指明任何檔案或測試。先找出內嵌快照和磁碟快照的比較路徑,接著確定應如何處理基於 repr() 的值,以及如何驗證相等性。兩種快照模式都有已達成共識的行為和相應的涵蓋率時,即視為完成。
由索引模型根據 Issue 內容生成。
描述
Python has a very cool repr() method, which returns the source code required to create the object. Not everything implements it, but Python's core datastructures do.
For inline snapshots it's pretty easy - we call repr() on argument, and put that inside the to_be() call.
For disk snapshots, we would have to read the value from the snapshot, call eval() on that string, and then hope that the comparison logic is implemented correctly.
In both cases, it muddies the concept of equality a bit, but allowing repr is so convenient that it's worth it.
- 主要語言
- Kotlin
- 星號
- 101
- 分支
- 18
- 平均合併
- 6 天 11 小時
- 30 天內合併 PR
- 5
環境準備
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
diffplug/selfie 的其他 Issue
-
Selfie JVM Snapshot Garbage Collection is overly zealous when using multiple test suites in gradle未關閉bug jvm
難度 4/5 3-5 天 新手友好度 48/100
-
enhancement jvm
難度 5/5 一週以上 新手友好度 25/100
-
bug jvm
難度 4/5 3-5 天 新手友好度 35/100
-
bug docs jvm
難度 2/5 1-3 小時 新手友好度 50/100
-
bug jvm py
難度 2/5 1-3 小時 新手友好度 48/100
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 92/100
-
難度 1/5 1 小時以內 新手友好度 92/100
-
難度 1/5 1 小時以內 新手友好度 95/100
-
bug
難度 2/5 1-3 小時 新手友好度 75/100
recloudstream/cloudstream#3226 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
Kotlin/kotlinx.serialization#3277 · 2 個 reaction ·
維護者通常 1 天內回覆