-
Notifications
You must be signed in to change notification settings - Fork 95
Add Python 3.12 to the test suite #764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
ccd41d2
3748e6a
39a80cf
d0cfd0e
887d6b0
164879d
ebd31f2
2a60d68
dcdb458
be93897
a0d1f72
cb03c5c
311c982
f1b954b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,8 +32,10 @@ | |
| import fnmatch | ||
| import functools | ||
| import inspect | ||
| import ntpath | ||
| import os | ||
| import pathlib | ||
| import posixpath | ||
| import re | ||
| import sys | ||
| from pathlib import PurePath | ||
|
|
@@ -383,6 +385,7 @@ class _FakeWindowsFlavour(_FakeFlavour): | |
| | {"COM%d" % i for i in range(1, 10)} | ||
| | {"LPT%d" % i for i in range(1, 10)} | ||
| ) | ||
| pathmod = ntpath | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This class attribute was present but seemingly unused before python/cpython#95450 |
||
|
|
||
| def is_reserved(self, parts): | ||
| """Return True if the path is considered reserved under Windows.""" | ||
|
|
@@ -459,6 +462,8 @@ class _FakePosixFlavour(_FakeFlavour): | |
| independent of FakeFilesystem properties. | ||
| """ | ||
|
|
||
| pathmod = posixpath | ||
|
|
||
| def is_reserved(self, parts): | ||
| return False | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -513,6 +513,15 @@ def test_read_text(self): | |
| file_path = self.path(self.make_path("text_file")) | ||
| self.assertEqual(file_path.read_text(), "foo") | ||
|
|
||
| @unittest.skipIf( | ||
| sys.version_info < (3, 12), | ||
| "is_junction method new in Python 3.12", | ||
| ) | ||
| def test_is_junction(self): | ||
| self.create_file(self.make_path("text_file"), contents="foo") | ||
| file_path = self.path(self.make_path("text_file")) | ||
| self.assertFalse(file_path.is_junction()) | ||
|
|
||
| def test_read_text_with_encoding(self): | ||
| self.create_file( | ||
| self.make_path("text_file"), contents="ерунда", encoding="cyrillic" | ||
|
|
@@ -632,6 +641,7 @@ def test_symlink_to(self): | |
| self.assertTrue(path.is_symlink()) | ||
|
|
||
| @unittest.skipIf(sys.version_info < (3, 8), "link_to new in Python 3.8") | ||
| @unittest.skipIf(sys.version_info >= (3, 12), "link_to removed in Python 3.12") | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this had been deprecated before (actually renamed to |
||
| def test_link_to(self): | ||
| self.skip_if_symlink_not_supported() | ||
| file_name = self.make_path("foo", "bar.txt") | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't that be != ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course 🤦🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The string literal must be written using single quotes: https://docs.github.com/en/actions/learn-github-actions/expressions#literals