koxudaxi/fastapi-code-generator

test_generate.py overwrites commited files

yyamano opened this issue · 0 comments

tests\test_generate.py overwrites files in tests/data/expected/openapi/modify_specific_routers/modified/using_routers_example as below.

C:\Users\yyamano\work\fastapi-code-generator>git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

C:\Users\yyamano\work\fastapi-code-generator>poetry run pytest
================================================= test session starts =================================================
platform win32 -- Python 3.10.5, pytest-7.2.0, pluggy-1.0.0
rootdir: C:\Users\yyamano\work\fastapi-code-generator
plugins: anyio-3.5.0, cov-4.0.0, mock-3.10.0
collected 10 items

tests\test_generate.py ..........                                                                                [100%]

================================================= 10 passed in 1.11s ==================================================

C:\Users\yyamano\work\fastapi-code-generator>git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   tests/data/expected/openapi/modify_specific_routers/modified/using_routers_example/dependencies.py
        modified:   tests/data/expected/openapi/modify_specific_routers/modified/using_routers_example/main.py
        modified:   tests/data/expected/openapi/modify_specific_routers/modified/using_routers_example/models.py
        modified:   tests/data/expected/openapi/modify_specific_routers/modified/using_routers_example/routers/fat_cats.py
        modified:   tests/data/expected/openapi/modify_specific_routers/modified/using_routers_example/routers/wild_boars.py

no changes added to commit (use "git add" and/or "git commit -a")
C:\Users\yyamano\work\fastapi-code-generator>git diff
diff --git a/tests/data/expected/openapi/modify_specific_routers/modified/using_routers_example/dependencies.py b/tests/data/expected/openapi/modify_specific_routers/modified/using_routers_example/dependencies.py
index ede6084..0392a20 100644
--- a/tests/data/expected/openapi/modify_specific_routers/modified/using_routers_example/dependencies.py
+++ b/tests/data/expected/openapi/modify_specific_routers/modified/using_routers_example/dependencies.py
@@ -1,11 +1,11 @@
-# generated by fastapi-codegen:
-#   filename:  using_routers_example.yaml
-#   timestamp: 2023-04-11T00:00:00+00:00
-
-from __future__ import annotations
-
-from typing import Optional
-
-from fastapi import Path
-
-from .models import FatCats, Pet, SlimDogs, WildBoars
+# generated by fastapi-codegen:

+#   filename:  using_routers_example.yaml

+#   timestamp: 2023-04-11T00:00:00+00:00

+

+from __future__ import annotations

+

+from typing import Optional

+

+from fastapi import Path

+

+from .models import FatCats, Pet, SlimDogs, WildBoars


[omitted]