Skip to content

Commit 168d819

Browse files
committed
updated convertible_from test to match union types over ty.Union
1 parent 0a6a62f commit 168d819

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

extras/fileformats/extras/core/tests/test_converter.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1-
import typing as ty
2-
import attrs
31
from pathlib import Path
2+
3+
import attrs
44
import pytest
55
from pydra.compose import python, shell
6-
from fileformats.generic import File, FileSet
7-
from fileformats.testing import Foo, Bar, Baz, Qux
8-
from fileformats.testing import ConvertibleToFile, ConcreteClass, AnotherConcreteClass
6+
7+
from conftest import write_test_file
98
from fileformats.core import converter
109
from fileformats.core.exceptions import FormatConversionError
11-
from conftest import write_test_file
10+
from fileformats.generic import File, FileSet
11+
from fileformats.testing import (
12+
AnotherConcreteClass,
13+
Bar,
14+
Baz,
15+
ConcreteClass,
16+
ConvertibleToFile,
17+
Foo,
18+
Qux,
19+
)
1220

1321

1422
@converter
@@ -95,13 +103,13 @@ def test_convert_mapped_conversion(work_dir):
95103
@pytest.mark.parametrize(
96104
["klass", "convertible_from"],
97105
[
98-
[Bar, ty.Union[Bar, Baz, Foo]],
99-
[Qux, ty.Union[Foo, Qux]],
106+
[Bar, Bar | Baz | Foo],
107+
[Qux, Foo | Qux],
100108
[Foo, Foo],
101109
[Baz, Baz],
102110
[
103111
ConvertibleToFile,
104-
ty.Union[AnotherConcreteClass, ConcreteClass, ConvertibleToFile],
112+
AnotherConcreteClass | ConcreteClass | ConvertibleToFile,
105113
],
106114
],
107115
)

0 commit comments

Comments
 (0)