Skip to content

Commit

Permalink
Fix test expectations for .gitignore comment created by Python 3.13+ …
Browse files Browse the repository at this point in the history
…venv

Since Python 3.13, the .gitignore file is created by venv:
python/cpython#108125

Fixes pypa#2670
  • Loading branch information
hroncok committed Nov 29, 2023
1 parent 996d563 commit 3e9d7ac
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/unit/create/test_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ def list_to_str(iterable):
assert result == "None"

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


def test_create_vcs_ignore_exists(tmp_path):
Expand Down

0 comments on commit 3e9d7ac

Please sign in to comment.