1
- import unittest
2
- import tempfile
3
1
import pathlib
2
+ import tempfile
3
+ import unittest
4
+
4
5
from pyperformance import _pyproject_toml
5
6
6
7
@@ -44,17 +45,17 @@ def test_parse_full_valid_project_section(self):
44
45
45
46
def test_parse_fails_on_missing_name (self ):
46
47
with tempfile .TemporaryDirectory () as tmpdir :
47
- toml_content = """
48
+ toml_content = """
48
49
[project]
49
50
version = "1.0"
50
51
"""
51
52
52
- with self .assertRaisesRegex (ValueError , r'missing required "name" field' ):
53
- _pyproject_toml .parse_pyproject_toml (toml_content , rootdir = str (tmpdir ))
53
+ with self .assertRaisesRegex (ValueError , r'missing required "name" field' ):
54
+ _pyproject_toml .parse_pyproject_toml (toml_content , rootdir = str (tmpdir ))
54
55
55
56
def test_parse_fails_on_unsupported_section (self ):
56
57
with tempfile .TemporaryDirectory () as tmpdir :
57
- toml_content = """
58
+ toml_content = """
58
59
[project]
59
60
name = "my-test-bench"
60
61
version = "1.0"
@@ -63,8 +64,8 @@ def test_parse_fails_on_unsupported_section(self):
63
64
key = "value"
64
65
"""
65
66
66
- with self .assertRaisesRegex (ValueError , "unsupported sections" ):
67
- _pyproject_toml .parse_pyproject_toml (toml_content , rootdir = str (tmpdir ))
67
+ with self .assertRaisesRegex (ValueError , "unsupported sections" ):
68
+ _pyproject_toml .parse_pyproject_toml (toml_content , rootdir = str (tmpdir ))
68
69
69
70
def test_parse_readme_file_missing_with_requirefiles_true (self ):
70
71
with tempfile .TemporaryDirectory () as tmpdir :
@@ -94,5 +95,6 @@ def test_parse_readme_file_missing_with_requirefiles_false(self):
94
95
)
95
96
self .assertEqual (data ["project" ]["readme" ]["file" ], "MISSING_README.md" )
96
97
98
+
97
99
if __name__ == "__main__" :
98
100
unittest .main ()
0 commit comments