Convert formatting to use ruff instead of yapf + isort (#26247)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2025-10-05 15:06:22 +01:00
committed by GitHub
parent 17edd8a807
commit d6953beb91
1508 changed files with 115244 additions and 94146 deletions

View File

@@ -7,11 +7,11 @@ import pytest
from tools.validate_config import validate_ast
_TestConfig1 = '''
_TestConfig1 = """
@config
class _TestConfig1:
pass
'''
"""
_TestConfig2 = '''
@config
@@ -21,12 +21,12 @@ class _TestConfig2:
"""docstring"""
'''
_TestConfig3 = '''
_TestConfig3 = """
@config
@dataclass
class _TestConfig3:
a: int = 1
'''
"""
_TestConfig4 = '''
@config
@@ -37,12 +37,15 @@ class _TestConfig4:
'''
@pytest.mark.parametrize(("test_config", "expected_error"), [
(_TestConfig1, "must be a dataclass"),
(_TestConfig2, "must have a default"),
(_TestConfig3, "must have a docstring"),
(_TestConfig4, "must use a single Literal"),
])
@pytest.mark.parametrize(
("test_config", "expected_error"),
[
(_TestConfig1, "must be a dataclass"),
(_TestConfig2, "must have a default"),
(_TestConfig3, "must have a docstring"),
(_TestConfig4, "must use a single Literal"),
],
)
def test_config(test_config, expected_error):
tree = ast.parse(test_config)
with pytest.raises(Exception, match=expected_error):