Convert patches to JSON-serializable dict.
(patches: Patches)
| 373 | |
| 374 | |
| 375 | def patches_to_json(patches: Patches) -> dict: |
| 376 | """Convert patches to JSON-serializable dict.""" |
| 377 | return { |
| 378 | cls_name: { |
| 379 | test_name: [spec._asdict() for spec in specs] |
| 380 | for test_name, specs in tests.items() |
| 381 | } |
| 382 | for cls_name, tests in patches.items() |
| 383 | } |
| 384 | |
| 385 | |
| 386 | def patches_from_json(data: dict) -> Patches: |