10000 Fix test expectations for .gitignore comment created by Python 3.13+ … · hroncok/virtualenv@3e9d7ac · GitHub
[go: up one dir, main page]

Skip to content

Commit 3e9d7ac

Browse files
committed
Fix test expectations for .gitignore comment created by Python 3.13+ venv
Since Python 3.13, the .gitignore file is created by venv: python/cpython#108125 Fixes pypa#2670
1 parent 996d563 commit 3e9d7ac

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/unit/create/test_creator.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,11 @@ def list_to_str(iterable):
217217
assert result == "None"
218218

219219
git_ignore = (dest / ".gitignore").read_text(encoding="utf-8")
220-
assert git_ignore.splitlines() == ["# created by virtualenv automatically", "*"]
220+
if creator_key == "venv" and sys.version_info >= (3, 13):
221+
comment = "# Created by venv; see https://docs.python.org/3/library/venv.html"
222+
else:
223+
comment = "# created by virtualenv automatically"
224+
assert git_ignore.splitlines() == [comment, "*"]
221225

222226

223227
def test_create_vcs_ignore_exists(tmp_path):

0 commit comments

Comments
 (0)
0