mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
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
This commit is contained in:
1 parent
7044d43dc8
commit
63de4387e7
7 files changed
+49
-21
No files matched your search
Vendored
+32
@@ -159,11 +159,43 @@ class DTraceNormalTests(TraceTests, unittest.TestCase):
|
||||
backend = DTraceBackend()
|
||||
optimize_python = 0
|
||||
|
||||
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
|
||||
def test_function_entry_return(self):
|
||||
return super().test_function_entry_return()
|
||||
|
||||
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
|
||||
def test_verify_call_opcodes(self):
|
||||
return super().test_verify_call_opcodes()
|
||||
|
||||
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
|
||||
def test_gc(self):
|
||||
return super().test_gc()
|
||||
|
||||
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
|
||||
def test_line(self):
|
||||
return super().test_line()
|
||||
|
||||
|
||||
class DTraceOptimizedTests(TraceTests, unittest.TestCase):
|
||||
backend = DTraceBackend()
|
||||
optimize_python = 2
|
||||
|
||||
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
|
||||
def test_function_entry_return(self):
|
||||
return super().test_function_entry_return()
|
||||
|
||||
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
|
||||
def test_verify_call_opcodes(self):
|
||||
return super().test_verify_call_opcodes()
|
||||
|
||||
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
|
||||
def test_gc(self):
|
||||
return super().test_gc()
|
||||
|
||||
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
|
||||
def test_line(self):
|
||||
return super().test_line()
|
||||
|
||||
|
||||
class SystemTapNormalTests(TraceTests, unittest.TestCase):
|
||||
backend = SystemTapBackend()
|
||||
|
||||
Vendored
+8
@@ -352,6 +352,14 @@ class TestGenericTest(GenericTest, unittest.TestCase):
|
||||
with self.assertRaisesRegex(ValueError, 'embedded null'):
|
||||
func(b'/tmp\x00abcds')
|
||||
|
||||
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
|
||||
def test_samestat_on_symlink(self):
|
||||
return super().test_samestat_on_symlink()
|
||||
|
||||
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
|
||||
def test_samefile_on_symlink(self):
|
||||
return super().test_samefile_on_symlink()
|
||||
|
||||
# Following TestCase is not supposed to be run from test_genericpath.
|
||||
# It is inherited by other test modules (ntpath, posixpath).
|
||||
|
||||
|
||||
Vendored
+8
@@ -1527,6 +1527,14 @@ class NtCommonTest(test_genericpath.CommonTest, unittest.TestCase):
|
||||
def test_expandvars_nonascii(self):
|
||||
return super().test_expandvars_nonascii()
|
||||
|
||||
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
|
||||
def test_samefile_on_symlink(self):
|
||||
return super().test_samefile_on_symlink()
|
||||
|
||||
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
|
||||
def test_samestat_on_symlink(self):
|
||||
return super().test_samestat_on_symlink()
|
||||
|
||||
|
||||
class PathLikeTests(NtpathTestCase):
|
||||
|
||||
|
||||
Vendored
-1
@@ -78,7 +78,6 @@ class PyCompileTestsBase:
|
||||
self.assertTrue(os.path.exists(self.pyc_path))
|
||||
self.assertFalse(os.path.exists(self.cache_path))
|
||||
|
||||
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
|
||||
def test_do_not_overwrite_symlinks(self):
|
||||
# In the face of a cfile argument being a symlink, bail out.
|
||||
# Issue #17222
|
||||
|
||||
Vendored
+1
-6
@@ -196,7 +196,6 @@ class TestRmTree(BaseTest, unittest.TestCase):
|
||||
self.assertIsInstance(victim, bytes)
|
||||
shutil.rmtree(victim)
|
||||
|
||||
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
|
||||
@os_helper.skip_unless_symlink
|
||||
def test_rmtree_fails_on_symlink_onerror(self):
|
||||
tmp = self.mkdtemp()
|
||||
@@ -216,7 +215,6 @@ class TestRmTree(BaseTest, unittest.TestCase):
|
||||
self.assertEqual(errors[0][1], link)
|
||||
self.assertIsInstance(errors[0][2][1], OSError)
|
||||
|
||||
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
|
||||
@os_helper.skip_unless_symlink
|
||||
def test_rmtree_fails_on_symlink_onexc(self):
|
||||
tmp = self.mkdtemp()
|
||||
@@ -1087,7 +1085,6 @@ class TestCopy(BaseTest, unittest.TestCase):
|
||||
shutil.copymode(src_link, dst_link)
|
||||
self.assertEqual(os.stat(src).st_mode, os.stat(dst).st_mode)
|
||||
|
||||
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
|
||||
@unittest.skipUnless(hasattr(os, 'lchmod') or os.name == 'nt', 'requires os.lchmod')
|
||||
@os_helper.skip_unless_symlink
|
||||
def test_copymode_symlink_to_symlink(self):
|
||||
@@ -1317,7 +1314,6 @@ class TestCopy(BaseTest, unittest.TestCase):
|
||||
self.assertTrue(os.path.exists(file2))
|
||||
self.assertEqual(os.stat(file1).st_mode, os.stat(file2).st_mode)
|
||||
|
||||
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
|
||||
@os_helper.skip_unless_symlink
|
||||
def test_copy_symlinks(self):
|
||||
tmp_dir = self.mkdtemp()
|
||||
@@ -1360,7 +1356,6 @@ class TestCopy(BaseTest, unittest.TestCase):
|
||||
self.assertEqual(getattr(file1_stat, 'st_flags'),
|
||||
getattr(file2_stat, 'st_flags'))
|
||||
|
||||
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
|
||||
@os_helper.skip_unless_symlink
|
||||
def test_copy2_symlinks(self):
|
||||
tmp_dir = self.mkdtemp()
|
||||
@@ -1445,7 +1440,6 @@ class TestCopy(BaseTest, unittest.TestCase):
|
||||
|
||||
### shutil.copyfile
|
||||
|
||||
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
|
||||
@os_helper.skip_unless_symlink
|
||||
def test_copyfile_symlinks(self):
|
||||
tmp_dir = self.mkdtemp()
|
||||
@@ -1483,6 +1477,7 @@ class TestCopy(BaseTest, unittest.TestCase):
|
||||
finally:
|
||||
shutil.rmtree(TESTFN, ignore_errors=True)
|
||||
|
||||
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
|
||||
@os_helper.skip_unless_symlink
|
||||
def test_dont_copy_file_onto_symlink_to_itself(self):
|
||||
# bug 851123.
|
||||
|
||||
Vendored
-11
@@ -325,21 +325,10 @@ class TestFilemode:
|
||||
class TestFilemodeCStat(TestFilemode, unittest.TestCase):
|
||||
statmod = c_stat
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
if sys.platform == "win32":
|
||||
@unittest.expectedFailure
|
||||
def test_link(self):
|
||||
super().test_link()
|
||||
|
||||
class TestFilemodePyStat(TestFilemode, unittest.TestCase):
|
||||
statmod = py_stat
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
if sys.platform == "win32":
|
||||
@unittest.expectedFailure
|
||||
def test_link(self):
|
||||
super().test_link()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Vendored
-3
@@ -1276,7 +1276,6 @@ class WriteTest(WriteTestBase, unittest.TestCase):
|
||||
self.assertEqual(tarinfo.name, tarinfo2.name)
|
||||
self.assertEqual(tarinfo.size, 3)
|
||||
|
||||
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
|
||||
@unittest.skipUnless(hasattr(os, "link"),
|
||||
"Missing hardlink implementation")
|
||||
def test_link_size(self):
|
||||
@@ -1301,7 +1300,6 @@ class WriteTest(WriteTestBase, unittest.TestCase):
|
||||
os_helper.unlink(target)
|
||||
os_helper.unlink(link)
|
||||
|
||||
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
|
||||
@os_helper.skip_unless_symlink
|
||||
def test_symlink_size(self):
|
||||
path = os.path.join(TEMPDIR, "symlink")
|
||||
@@ -1849,7 +1847,6 @@ class HardlinkTest(unittest.TestCase):
|
||||
self.assertEqual(tarinfo.type, tarfile.REGTYPE,
|
||||
"add file as regular failed")
|
||||
|
||||
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
|
||||
def test_add_hardlink(self):
|
||||
tarinfo = self.tar.gettarinfo(self.bar)
|
||||
self.assertEqual(tarinfo.type, tarfile.LNKTYPE,
|
||||
|
||||
Reference in new issue
Block a user