1- import unittest
2- import tempfile
31import pathlib
2+ import tempfile
3+ import unittest
4+
45from pyperformance import _pyproject_toml
56
67
@@ -44,17 +45,17 @@ def test_parse_full_valid_project_section(self):
4445
4546 def test_parse_fails_on_missing_name (self ):
4647 with tempfile .TemporaryDirectory () as tmpdir :
47- toml_content = """
48+ toml_content = """
4849 [project]
4950 version = "1.0"
5051 """
5152
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 ))
5455
5556 def test_parse_fails_on_unsupported_section (self ):
5657 with tempfile .TemporaryDirectory () as tmpdir :
57- toml_content = """
58+ toml_content = """
5859 [project]
5960 name = "my-test-bench"
6061 version = "1.0"
@@ -63,8 +64,8 @@ def test_parse_fails_on_unsupported_section(self):
6364 key = "value"
6465 """
6566
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 ))
6869
6970 def test_parse_readme_file_missing_with_requirefiles_true (self ):
7071 with tempfile .TemporaryDirectory () as tmpdir :
@@ -94,5 +95,6 @@ def test_parse_readme_file_missing_with_requirefiles_false(self):
9495 )
9596 self .assertEqual (data ["project" ]["readme" ]["file" ], "MISSING_README.md" )
9697
98+
9799if __name__ == "__main__" :
98100 unittest .main ()
0 commit comments