Skip to content

Commit 36b7e24

Browse files
committed
fixed another pytest fixture
1 parent 14fc12a commit 36b7e24

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
from conftest import write_test_file
1111

1212

13-
def foo_bar_converter():
13+
@pytest.fixture
14+
def FooBarConverter():
1415
work_dir = Path(tempfile.mkdtemp())
1516

1617
@converter
1718
@python.define(outputs={"out_file": Bar}) # type: ignore[misc]
18-
def foo_bar_converter_(in_file: Foo):
19+
def FooBarConverter_(in_file: Foo):
1920
return Bar(write_test_file(work_dir / "bar.bar", in_file.raw_contents))
2021

21-
return foo_bar_converter_
22+
return FooBarConverter_
2223

2324

2425
def baz_bar_converter():
@@ -53,13 +54,11 @@ class Outputs(shell.Outputs):
5354
return FooQuxConverter_
5455

5556

56-
def test_get_converter_functask(foo_bar_converter, work_dir):
57+
def test_get_converter_functask(FooBarConverter, work_dir):
5758

5859
fspath = work_dir / "test.foo"
5960
write_test_file(fspath)
60-
assert attrs.asdict(Bar.get_converter(Foo).task) == attrs.asdict(
61-
foo_bar_converter()
62-
)
61+
assert attrs.asdict(Bar.get_converter(Foo).task) == attrs.asdict(FooBarConverter())
6362

6463

6564
def test_get_converter_shellcmd(FooQuxConverter, work_dir):
@@ -77,7 +76,7 @@ def test_get_converter_fail(work_dir):
7776
Baz.get_converter(Foo)
7877

7978

80-
def test_convert_functask(foo_bar_converter, work_dir):
79+
def test_convert_functask(FooBarConverter, work_dir):
8180

8281
fspath = work_dir / "test.foo"
8382
write_test_file(fspath)

0 commit comments

Comments
 (0)