File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -1085,13 +1085,23 @@ def test_makefile_warts(testdir: Testdir) -> None:
10851085 Additional issues:
10861086 - always strips and dedents.
10871087 """
1088+
1089+ def list_files ():
1090+ return sorted ([os .path .basename (x ) for x in testdir .tmpdir .listdir ()])
1091+
10881092 # Requires "ext".
10891093 with pytest .raises (TypeError , match = "required positional argument" ):
10901094 testdir .makefile (foo = "" ) # type: ignore[call-arg] # noqa: F821
10911095
1092- # Cannot create a file named "ext".
1093- p1 = testdir .makefile (ext = "" )
1094- assert p1 is None
1096+ # Requires items to be created.
1097+ with pytest .raises (TypeError ):
1098+ testdir .makefile () # type: ignore[call-arg] # noqa: F821
1099+ with pytest .raises (ValueError , match = r"^no files to create$" ):
1100+ testdir .makefile (None )
1101+ with pytest .raises (ValueError , match = r"^no files to create$" ):
1102+ testdir .makefile (ext = "" )
1103+ assert list_files () == []
1104+
10951105 assert testdir .tmpdir .listdir () == []
10961106
10971107 with pytest .raises (TypeError , match = "got multiple values for argument 'ext'" ):
You can’t perform that action at this time.
0 commit comments