@@ -19,14 +19,10 @@ def temp_project_dir(tmp_path: Path, monkeypatch: Any) -> Path:
1919
2020
2121class TestNewCommand :
22- def _assert_project_created (
23- self , project_path : Path , check_version_file : bool = False
24- ) -> None :
22+ def _assert_project_created (self , project_path : Path ) -> None :
2523 assert (project_path / "main.py" ).exists ()
2624 assert (project_path / "README.md" ).exists ()
2725 assert (project_path / "pyproject.toml" ).exists ()
28- if check_version_file :
29- assert (project_path / ".python-version" ).exists ()
3026
3127 def test_creates_project_successfully (self , temp_project_dir : Path ) -> None :
3228 result = runner .invoke (app , ["my_fastapi_project" ])
@@ -42,22 +38,14 @@ def test_creates_project_with_python_version(self, temp_project_dir: Path) -> No
4238 result = runner .invoke (app , ["project_long" , "--python" , "3.12" ])
4339 assert result .exit_code == 0
4440 project_path = temp_project_dir / "project_long"
45- self ._assert_project_created (project_path , check_version_file = True )
46- assert "3.12" in (project_path / ".python-version " ).read_text ()
41+ self ._assert_project_created (project_path )
42+ assert "3.12" in (project_path / "pyproject.toml " ).read_text ()
4743
4844 # Test short form
4945 result = runner .invoke (app , ["project_short" , "-p" , "3.11" ])
5046 assert result .exit_code == 0
5147 project_path = temp_project_dir / "project_short"
52- assert "3.11" in (project_path / ".python-version" ).read_text ()
53-
54- def test_creates_project_with_extra_uv_flags (self , temp_project_dir : Path ) -> None :
55- """Test that extra flags are passed through to uv."""
56- result = runner .invoke (app , ["my_fastapi_project" , "--python" , "3.12" , "--lib" ])
57-
58- assert result .exit_code == 0
59- project_path = temp_project_dir / "my_fastapi_project"
60- self ._assert_project_created (project_path )
48+ assert "3.11" in (project_path / "pyproject.toml" ).read_text ()
6149
6250 def test_validates_template_file_contents (self , temp_project_dir : Path ) -> None :
6351 result = runner .invoke (app , ["sample_project" ])
@@ -122,14 +110,6 @@ def test_creates_project_without_python_flag(self, temp_project_dir: Path) -> No
122110 project_path = temp_project_dir / "test_project"
123111 self ._assert_project_created (project_path )
124112
125- def test_creates_project_with_other_uv_flags_no_python (
126- self , temp_project_dir : Path
127- ) -> None :
128- result = runner .invoke (app , ["test_project" , "--lib" ])
129- assert result .exit_code == 0
130- project_path = temp_project_dir / "test_project"
131- self ._assert_project_created (project_path )
132-
133113
134114class TestNewCommandUvFailures :
135115 def test_failed_to_initialize_with_uv (self , monkeypatch : Any ) -> None :
0 commit comments