88from usethis ._config_file import files_manager
99from usethis ._file .pyproject_toml .errors import PyprojectTOMLInitError
1010from usethis ._file .pyproject_toml .io_ import PyprojectTOMLManager
11+ from usethis ._file .setup_cfg .io_ import SetupCFGManager
1112from usethis ._init import (
1213 _BUILD_SYSTEM_CONFIG ,
1314 ensure_pyproject_toml ,
@@ -279,7 +280,7 @@ def mock_ensure_pyproject_toml_via_poetry(*, author: bool = True) -> None:
279280class TestWriteSimpleRequirementsTxt :
280281 def test_no_pyproject_toml (self , tmp_path : Path ):
281282 # Act
282- with change_cwd (tmp_path ), PyprojectTOMLManager ():
283+ with change_cwd (tmp_path ), PyprojectTOMLManager (), SetupCFGManager () :
283284 write_simple_requirements_txt ()
284285
285286 # Assert
@@ -299,7 +300,7 @@ def test_no_dependencies(self, tmp_path: Path):
299300 )
300301
301302 # Act
302- with change_cwd (tmp_path ), PyprojectTOMLManager ():
303+ with change_cwd (tmp_path ), PyprojectTOMLManager (), SetupCFGManager () :
303304 write_simple_requirements_txt ()
304305
305306 # Assert
@@ -322,7 +323,7 @@ def test_with_dependencies(self, tmp_path: Path):
322323 )
323324
324325 # Act
325- with change_cwd (tmp_path ), PyprojectTOMLManager ():
326+ with change_cwd (tmp_path ), PyprojectTOMLManager (), SetupCFGManager () :
326327 write_simple_requirements_txt ()
327328
328329 # Assert
@@ -345,7 +346,7 @@ def test_with_dependencies_with_extras(self, tmp_path: Path):
345346 )
346347
347348 # Act
348- with change_cwd (tmp_path ), PyprojectTOMLManager ():
349+ with change_cwd (tmp_path ), PyprojectTOMLManager (), SetupCFGManager () :
349350 write_simple_requirements_txt ()
350351
351352 # Assert
@@ -359,7 +360,7 @@ def test_overwrites_existing_file(self, tmp_path: Path):
359360 (tmp_path / "requirements.txt" ).write_text ("old content" )
360361
361362 # Act
362- with change_cwd (tmp_path ), PyprojectTOMLManager ():
363+ with change_cwd (tmp_path ), PyprojectTOMLManager (), SetupCFGManager () :
363364 write_simple_requirements_txt ()
364365
365366 # Assert
0 commit comments