|
|
99a46d |
From 11c30f6c69c4516b406c1c62f472d37898c58b93 Mon Sep 17 00:00:00 2001
|
|
|
99a46d |
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
|
|
|
99a46d |
Date: Mon, 4 Dec 2023 14:26:52 +0100
|
|
|
99a46d |
Subject: [PATCH] Run CI tests on Python 3.13, fix tests (#2673)
|
|
|
99a46d |
|
|
|
99a46d |
---
|
|
|
99a46d |
docs/changelog/2673.feature.rst | 1 +
|
|
|
99a46d |
tests/unit/create/test_creator.py | 6 +++++-
|
|
|
99a46d |
tests/unit/create/via_global_ref/builtin/testing/path.py | 6 +++++-
|
|
|
99a46d |
3 files changed, 11 insertions(+), 2 deletions(-)
|
|
|
99a46d |
create mode 100644 docs/changelog/2673.feature.rst
|
|
|
99a46d |
|
|
|
99a46d |
diff --git a/docs/changelog/2673.feature.rst b/docs/changelog/2673.feature.rst
|
|
|
99a46d |
new file mode 100644
|
|
|
99a46d |
index 0000000..0adf4a0
|
|
|
99a46d |
--- /dev/null
|
|
|
99a46d |
+++ b/docs/changelog/2673.feature.rst
|
|
|
99a46d |
@@ -0,0 +1 @@
|
|
|
99a46d |
+The tests now pass on the CI with Python 3.13.0a2 - by :user:`hroncok`.
|
|
|
99a46d |
diff --git a/tests/unit/create/test_creator.py b/tests/unit/create/test_creator.py
|
|
|
99a46d |
index 8b9d688..fc21ad8 100644
|
|
|
99a46d |
--- a/tests/unit/create/test_creator.py
|
|
|
99a46d |
+++ b/tests/unit/create/test_creator.py
|
|
|
99a46d |
@@ -231,7 +231,11 @@ def test_create_no_seed(python, creator, isolated, system, coverage_env, special
|
|
|
99a46d |
assert os.path.exists(make_file)
|
|
|
99a46d |
|
|
|
99a46d |
git_ignore = (dest / ".gitignore").read_text(encoding="utf-8")
|
|
|
99a46d |
- assert git_ignore.splitlines() == ["# created by virtualenv automatically", "*"]
|
|
|
99a46d |
+ if creator_key == "venv" and sys.version_info >= (3, 13):
|
|
|
99a46d |
+ comment = "# Created by venv; see https://docs.python.org/3/library/venv.html"
|
|
|
99a46d |
+ else:
|
|
|
99a46d |
+ comment = "# created by virtualenv automatically"
|
|
|
99a46d |
+ assert git_ignore.splitlines() == [comment, "*"]
|
|
|
99a46d |
|
|
|
99a46d |
|
|
|
99a46d |
def test_create_vcs_ignore_exists(tmp_path):
|
|
|
99a46d |
diff --git a/tests/unit/create/via_global_ref/builtin/testing/path.py b/tests/unit/create/via_global_ref/builtin/testing/path.py
|
|
|
99a46d |
index b2e1b85..d833de6 100644
|
|
|
99a46d |
--- a/tests/unit/create/via_global_ref/builtin/testing/path.py
|
|
|
99a46d |
+++ b/tests/unit/create/via_global_ref/builtin/testing/path.py
|
|
|
99a46d |
@@ -44,11 +44,15 @@ class PathMockABC(FakeDataABC, Path):
|
|
|
99a46d |
"""Mocks the behavior of `Path`"""
|
|
|
99a46d |
|
|
|
99a46d |
_flavour = getattr(Path(), "_flavour", None)
|
|
|
99a46d |
-
|
|
|
99a46d |
if hasattr(_flavour, "altsep"):
|
|
|
99a46d |
# Allows to pass some tests for Windows via PosixPath.
|
|
|
99a46d |
_flavour.altsep = _flavour.altsep or "\\"
|
|
|
99a46d |
|
|
|
99a46d |
+ # Python 3.13 renamed _flavour to parser
|
|
|
99a46d |
+ parser = getattr(Path(), "parser", None)
|
|
|
99a46d |
+ if hasattr(parser, "altsep"):
|
|
|
99a46d |
+ parser.altsep = parser.altsep or "\\"
|
|
|
99a46d |
+
|
|
|
99a46d |
def exists(self):
|
|
|
99a46d |
return self.is_file() or self.is_dir()
|
|
|
99a46d |
|
|
|
99a46d |
--
|
|
|
99a46d |
2.43.0
|
|
|
99a46d |
|