1
1
import errno
2
+ import textwrap
2
3
from pathlib import Path
3
4
from typing import Any
4
5
@@ -13,10 +14,12 @@ def test_parse_simple_dependency_groups(
13
14
) -> None :
14
15
pyproject = tmp_path .joinpath ("pyproject.toml" )
15
16
pyproject .write_text (
16
- """\
17
- [dependency-groups]
18
- foo = ["bar"]
19
- """
17
+ textwrap .dedent (
18
+ """\
19
+ [dependency-groups]
20
+ foo = ["bar"]
21
+ """
22
+ )
20
23
)
21
24
monkeypatch .chdir (tmp_path )
22
25
@@ -31,11 +34,13 @@ def test_parse_cyclic_dependency_groups(
31
34
) -> None :
32
35
pyproject = tmp_path .joinpath ("pyproject.toml" )
33
36
pyproject .write_text (
34
- """\
35
- [dependency-groups]
36
- foo = [{include-group="bar"}]
37
- bar = [{include-group="foo"}]
38
- """
37
+ textwrap .dedent (
38
+ """\
39
+ [dependency-groups]
40
+ foo = [{include-group="bar"}]
41
+ bar = [{include-group="foo"}]
42
+ """
43
+ )
39
44
)
40
45
monkeypatch .chdir (tmp_path )
41
46
@@ -54,10 +59,7 @@ def test_parse_with_no_dependency_groups_defined(
54
59
tmp_path : Path , monkeypatch : pytest .MonkeyPatch
55
60
) -> None :
56
61
pyproject = tmp_path .joinpath ("pyproject.toml" )
57
- pyproject .write_text (
58
- """\
59
- """
60
- )
62
+ pyproject .write_text ("" )
61
63
monkeypatch .chdir (tmp_path )
62
64
63
65
with pytest .raises (
@@ -80,10 +82,12 @@ def test_parse_with_malformed_pyproject_file(
80
82
) -> None :
81
83
pyproject = tmp_path .joinpath ("pyproject.toml" )
82
84
pyproject .write_text (
83
- """\
84
- [dependency-groups # no closing bracket
85
- foo = ["bar"]
86
- """
85
+ textwrap .dedent (
86
+ """\
87
+ [dependency-groups # no closing bracket
88
+ foo = ["bar"]
89
+ """
90
+ )
87
91
)
88
92
monkeypatch .chdir (tmp_path )
89
93
@@ -96,10 +100,12 @@ def test_parse_gets_unexpected_oserror(
96
100
) -> None :
97
101
pyproject = tmp_path .joinpath ("pyproject.toml" )
98
102
pyproject .write_text (
99
- """\
100
- [dependency-groups]
101
- foo = ["bar"]
102
- """
103
+ textwrap .dedent (
104
+ """\
105
+ [dependency-groups]
106
+ foo = ["bar"]
107
+ """
108
+ )
103
109
)
104
110
monkeypatch .chdir (tmp_path )
105
111
0 commit comments