Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 63de438

Browse files
authored
Fix broken CI on windows (#6143)
* Fix `test_dtrace.py` * Fix `test_genericpath.py` * fix `test_ntpath.py` * Fix `test_py_compile.py` * Fix `test_shutil.py` * fix `test_stat.py` * Fix `test_tarfile.py` * Mark failing tests
1 parent 7044d43 commit 63de438

File tree

7 files changed

+49
-21
lines changed

7 files changed

+49
-21
lines changed

Lib/test/test_dtrace.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,43 @@ class DTraceNormalTests(TraceTests, unittest.TestCase):
159159
backend = DTraceBackend()
160160
optimize_python = 0
161161

162+
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
163+
def test_function_entry_return(self):
164+
return super().test_function_entry_return()
165+
166+
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
167+
def test_verify_call_opcodes(self):
168+
return super().test_verify_call_opcodes()
169+
170+
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
171+
def test_gc(self):
172+
return super().test_gc()
173+
174+
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
175+
def test_line(self):
176+
return super().test_line()
177+
162178

163179
class DTraceOptimizedTests(TraceTests, unittest.TestCase):
164180
backend = DTraceBackend()
165181
optimize_python = 2
166182

183+
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
184+
def test_function_entry_return(self):
185+
return super().test_function_entry_return()
186+
187+
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
188+
def test_verify_call_opcodes(self):
189+
return super().test_verify_call_opcodes()
190+
191+
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
192+
def test_gc(self):
193+
return super().test_gc()
194+
195+
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
196+
def test_line(self):
197+
return super().test_line()
198+
167199

168200
class SystemTapNormalTests(TraceTests, unittest.TestCase):
169201
backend = SystemTapBackend()

Lib/test/test_genericpath.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,14 @@ def test_invalid_paths(self):
352352
with self.assertRaisesRegex(ValueError, 'embedded null'):
353353
func(b'/tmp\x00abcds')
354354

355+
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
356+
def test_samestat_on_symlink(self):
357+
return super().test_samestat_on_symlink()
358+
359+
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
360+
def test_samefile_on_symlink(self):
361+
return super().test_samefile_on_symlink()
362+
355363
# Following TestCase is not supposed to be run from test_genericpath.
356364
# It is inherited by other test modules (ntpath, posixpath).
357365

Lib/test/test_ntpath.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,6 +1527,14 @@ def test_expandvars(self):
15271527
def test_expandvars_nonascii(self):
15281528
return super().test_expandvars_nonascii()
15291529

1530+
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
1531+
def test_samefile_on_symlink(self):
1532+
return super().test_samefile_on_symlink()
1533+
1534+
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
1535+
def test_samestat_on_symlink(self):
1536+
return super().test_samestat_on_symlink()
1537+
15301538

15311539
class PathLikeTests(NtpathTestCase):
15321540

Lib/test/test_py_compile.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ def test_absolute_path(self):
7878
self.assertTrue(os.path.exists(self.pyc_path))
7979
self.assertFalse(os.path.exists(self.cache_path))
8080

81-
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
8281
def test_do_not_overwrite_symlinks(self):
8382
# In the face of a cfile argument being a symlink, bail out.
8483
# Issue #17222

Lib/test/test_shutil.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ def test_rmtree_works_on_bytes(self):
196196
self.assertIsInstance(victim, bytes)
197197
shutil.rmtree(victim)
198198

199-
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
200199
@os_helper.skip_unless_symlink
201200
def test_rmtree_fails_on_symlink_onerror(self):
202201
tmp = self.mkdtemp()
@@ -216,7 +215,6 @@ def onerror(*args):
216215
self.assertEqual(errors[0][1], link)
217216
self.assertIsInstance(errors[0][2][1], OSError)
218217

219-
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
220218
@os_helper.skip_unless_symlink
221219
def test_rmtree_fails_on_symlink_onexc(self):
222220
tmp = self.mkdtemp()
@@ -1087,7 +1085,6 @@ def test_copymode_follow_symlinks(self):
10871085
shutil.copymode(src_link, dst_link)
10881086
self.assertEqual(os.stat(src).st_mode, os.stat(dst).st_mode)
10891087

1090-
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
10911088
@unittest.skipUnless(hasattr(os, 'lchmod') or os.name == 'nt', 'requires os.lchmod')
10921089
@os_helper.skip_unless_symlink
10931090
def test_copymode_symlink_to_symlink(self):
@@ -1317,7 +1314,6 @@ def test_copy(self):
13171314
self.assertTrue(os.path.exists(file2))
13181315
self.assertEqual(os.stat(file1).st_mode, os.stat(file2).st_mode)
13191316

1320-
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
13211317
@os_helper.skip_unless_symlink
13221318
def test_copy_symlinks(self):
13231319
tmp_dir = self.mkdtemp()
@@ -1360,7 +1356,6 @@ def test_copy2(self):
13601356
self.assertEqual(getattr(file1_stat, 'st_flags'),
13611357
getattr(file2_stat, 'st_flags'))
13621358

1363-
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
13641359
@os_helper.skip_unless_symlink
13651360
def test_copy2_symlinks(self):
13661361
tmp_dir = self.mkdtemp()
@@ -1445,7 +1440,6 @@ def _test_copy_dir(self, copy_func):
14451440

14461441
### shutil.copyfile
14471442

1448-
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
14491443
@os_helper.skip_unless_symlink
14501444
def test_copyfile_symlinks(self):
14511445
tmp_dir = self.mkdtemp()
@@ -1483,6 +1477,7 @@ def test_dont_copy_file_onto_link_to_itself(self):
14831477
finally:
14841478
shutil.rmtree(TESTFN, ignore_errors=True)
14851479

1480+
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
14861481
@os_helper.skip_unless_symlink
14871482
def test_dont_copy_file_onto_symlink_to_itself(self):
14881483
# bug 851123.

Lib/test/test_stat.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -325,21 +325,10 @@ def test_macosx_attribute_values(self):
325325
class TestFilemodeCStat(TestFilemode, unittest.TestCase):
326326
statmod = c_stat
327327

328-
# TODO: RUSTPYTHON
329-
if sys.platform == "win32":
330-
@unittest.expectedFailure
331-
def test_link(self):
332-
super().test_link()
333328

334329
class TestFilemodePyStat(TestFilemode, unittest.TestCase):
335330
statmod = py_stat
336331

337-
# TODO: RUSTPYTHON
338-
if sys.platform == "win32":
339-
@unittest.expectedFailure
340-
def test_link(self):
341-
super().test_link()
342-
343332

344333
if __name__ == '__main__':
345334
unittest.main()

Lib/test/test_tarfile.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,7 +1276,6 @@ def test_gettarinfo_pathlike_name(self):
12761276
self.assertEqual(tarinfo.name, tarinfo2.name)
12771277
self.assertEqual(tarinfo.size, 3)
12781278

1279-
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
12801279
@unittest.skipUnless(hasattr(os, "link"),
12811280
"Missing hardlink implementation")
12821281
def test_link_size(self):
@@ -1301,7 +1300,6 @@ def test_link_size(self):
13011300
os_helper.unlink(target)
13021301
os_helper.unlink(link)
13031302

1304-
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
13051303
@os_helper.skip_unless_symlink
13061304
def test_symlink_size(self):
13071305
path = os.path.join(TEMPDIR, "symlink")
@@ -1849,7 +1847,6 @@ def test_add_twice(self):
18491847
self.assertEqual(tarinfo.type, tarfile.REGTYPE,
18501848
"add file as regular failed")
18511849

1852-
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
18531850
def test_add_hardlink(self):
18541851
tarinfo = self.tar.gettarinfo(self.bar)
18551852
self.assertEqual(tarinfo.type, tarfile.LNKTYPE,

0 commit comments

Comments
 (0)