We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4deba4b + 64b6c34 commit 3a694fdCopy full SHA for 3a694fd
tests/test_make.py
@@ -247,7 +247,8 @@ class A:
247
assert attr.fields(A).x.metadata["foo"] == 1
248
249
250
-def test_union(module, dump_load_assert):
+@pytest.mark.parametrize(argnames=['value'], argvalues=[["X"], [5]])
251
+def test_union(module, value, dump_load_assert):
252
"""Deserialize one of several types."""
253
254
@module.dataclass
@@ -256,12 +257,8 @@ class A:
256
257
258
schema = desert.schema_class(A)()
259
- dumped = {"x": "X"}
260
- loaded = A("X")
261
- dump_load_assert(schema=schema, loaded=loaded, dumped=dumped)
262
-
263
- dumped = {"x": 5}
264
- loaded = A(5)
+ dumped = {"x": value}
+ loaded = A(value)
265
dump_load_assert(schema=schema, loaded=loaded, dumped=dumped)
266
267
0 commit comments