Commit 7585f45
committed
Ensure subtest's context kwargs are JSON serializable
Convert all the values of `SubtestContext.kwargs` to strings using `saferepr`.
This complies with the requirement that the returned dict from `pytest_report_to_serializable` is serializable to JSON, at the cost of losing type information for objects that are natively supported by JSON.
Fixes pytest-dev/pytest-xdist#12731 parent 90b9389 commit 7585f45
File tree
3 files changed
+43
-3
lines changed- changelog
- src/_pytest
- testing
3 files changed
+43
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
958 | 960 | | |
959 | 961 | | |
960 | 962 | | |
| 963 | + | |
961 | 964 | | |
962 | 965 | | |
963 | 966 | | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
964 | 970 | | |
965 | 971 | | |
966 | 972 | | |
967 | 973 | | |
968 | 974 | | |
969 | 975 | | |
970 | 976 | | |
971 | | - | |
| 977 | + | |
972 | 978 | | |
973 | 979 | | |
974 | 980 | | |
975 | 981 | | |
976 | 982 | | |
977 | | - | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
0 commit comments