We cannot run test_delete_false
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python311?expand=0&rev=106
This commit is contained in:
parent
27413421cf
commit
5c654e8335
@ -1,8 +1,8 @@
|
||||
---
|
||||
Lib/tempfile.py | 16 +
|
||||
Lib/test/test_tempfile.py | 119 ++++++++++
|
||||
Lib/test/test_tempfile.py | 113 ++++++++++
|
||||
Misc/NEWS.d/next/Library/2022-12-01-16-57-44.gh-issue-91133.LKMVCV.rst | 2
|
||||
3 files changed, 137 insertions(+)
|
||||
3 files changed, 131 insertions(+)
|
||||
|
||||
--- a/Lib/tempfile.py
|
||||
+++ b/Lib/tempfile.py
|
||||
@ -135,12 +135,10 @@
|
||||
@support.cpython_only
|
||||
def test_del_on_collection(self):
|
||||
# A TemporaryDirectory is deleted when garbage collected
|
||||
@@ -1861,6 +1958,22 @@ class TestTemporaryDirectory(BaseTestCas
|
||||
finally:
|
||||
os_helper.unlink(filename)
|
||||
@@ -1847,6 +1944,22 @@ class TestTemporaryDirectory(BaseTestCas
|
||||
|
||||
+ def check_flags(self, flags):
|
||||
+ # skip the test if these flags are not supported (ex: FreeBSD 13)
|
||||
def check_flags(self, flags):
|
||||
# skip the test if these flags are not supported (ex: FreeBSD 13)
|
||||
+ filename = os_helper.TESTFN
|
||||
+ try:
|
||||
+ open(filename, "w").close()
|
||||
@ -155,22 +153,11 @@
|
||||
+ finally:
|
||||
+ os_helper.unlink(filename)
|
||||
+
|
||||
@unittest.skipUnless(hasattr(os, 'chflags'), 'requires os.chflags')
|
||||
def test_flags(self):
|
||||
flags = stat.UF_IMMUTABLE | stat.UF_NOUNLINK
|
||||
@@ -1876,6 +1989,12 @@ class TestTemporaryDirectory(BaseTestCas
|
||||
d.cleanup()
|
||||
self.assertFalse(os.path.exists(d.name))
|
||||
|
||||
+ def test_delete_false(self):
|
||||
+ with tempfile.TemporaryDirectory(delete=False) as working_dir:
|
||||
+ pass
|
||||
+ self.assertTrue(os.path.exists(working_dir))
|
||||
+ shutil.rmtree(working_dir)
|
||||
+
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
+ def check_flags(self, flags):
|
||||
+ # skip the test if these flags are not supported (ex: FreeBSD 13)
|
||||
filename = os_helper.TESTFN
|
||||
try:
|
||||
open(filename, "w").close()
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Library/2022-12-01-16-57-44.gh-issue-91133.LKMVCV.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
|
Loading…
Reference in New Issue
Block a user