ref: Use pathlib in tests (#4159)

Use pathlib in tests
This commit is contained in:
Christophe Bornet 2024-10-15 19:51:50 +02:00 • committed by GitHub
commit eb53f66641
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 59 additions and 87 deletions

View file

@ -1,5 +1,6 @@
import ast
import types
from pathlib import Path
from textwrap import dedent
import pytest
@ -18,9 +19,8 @@ def client():
@pytest.fixture
def code_component_with_multiple_outputs():
with open("src/backend/tests/data/component_multiple_outputs.py") as f:
code = f.read()
return Component(_code=code)
code = Path("src/backend/tests/data/component_multiple_outputs.py").read_text()
return Component(_code=code)
code_default = """