8000 platform-dependent Windows testing (#5536) · RustPython/RustPython@b4f0a58 · GitHub
[go: up one dir, main page]

Skip to content

Commit b4f0a58

Browse files
authored
platform-dependent Windows testing (#5536)
* disable test_argparse on windows * fix test_exceptions and mark it as platform dependent * test importlib on windows * explain why windows tests fail * mark test_argparse as non platform-independent Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
1 parent 331a3c1 commit b4f0a58

File tree

5 files changed

+25
-6
lines changed

5 files changed

+25
-6
lines changed

.github/workflows/ci.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,23 @@ concurrency:
1717
env:
1818
CARGO_ARGS: --no-default-features --features stdlib,zlib,importlib,encodings,sqlite,ssl
1919
# Skip additional tests on Windows. They are checked on Linux and MacOS.
20+
# test_argparse: UnicodeDecodeError
21+
# test_glob: many failing tests
22+
# test_io: many failing tests
23+
# test_os: many failing tests
24+
# test_pathlib: support.rmtree() failing
25+
# test_posixpath: OSError: (22, 'The filename, directory name, or volume label syntax is incorrect. (os error 123)')
26+
# test_unicode: AttributeError: module '_winapi' has no attribute 'GetACP'
27+
# test_venv: couple of failing tests
2028
WINDOWS_SKIPS: >-
29+
test_argparse
2130
test_glob
22-
test_importlib
2331
test_io
2432
test_os
33+
test_rlcompleter
2534
test_pathlib
2635
test_posixpath
36+
test_unicode
2737
test_venv
2838
# configparser: https://github.com/RustPython/RustPython/issues/4995#issuecomment-1582397417
2939
# socketserver: seems related to configparser crash.
@@ -34,7 +44,6 @@ env:
3444
# only run on Linux to speed up the CI.
3545
PLATFORM_INDEPENDENT_TESTS: >-
3646
test__colorize
37-
test_argparse
3847
test_array
3948
test_asyncgen
4049
test_binop
@@ -59,7 +68,6 @@ env:
5968
test_dis
6069
test_enumerate
6170
test_exception_variations
62-
test_exceptions
6371
test_float
6472
test_format
6573
test_fractions
@@ -100,7 +108,6 @@ env:
100108
test_tuple
101109
test_types
102110
test_unary
103-
test_unicode
104111
test_unpack
105112
test_weakref
106113
test_yield_from

Lib/test/test_importlib/frozen/test_loader.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import contextlib
88
import marshal
99
import os.path
10+
import sys
1011
import types
1112
import unittest
1213
import warnings
@@ -77,6 +78,7 @@ def test_module(self):
7778
self.assertTrue(hasattr(module, '__spec__'))
7879
self.assertEqual(module.__spec__.loader_state.origname, name)
7980

81+
@unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON")
8082
def test_package(self):
8183
name = '__phello__'
8284
module, output = self.exec_module(name)
@@ -90,6 +92,7 @@ def test_package(self):
9092
self.assertEqual(output, 'Hello world!\n')
9193
self.assertEqual(module.__spec__.loader_state.origname, name)
9294

95+
@unittest.skipIf(sys.platform == 'win32', "TODO:RUSTPYTHON Flaky on Windows")
9396
def test_lacking_parent(self):
9497
name = '__phello__.spam'
9598
with util.uncache('__phello__'):
@@ -147,6 +150,7 @@ def test_get_source(self):
147150
result = self.machinery.FrozenImporter.get_source('__hello__')
148151
self.assertIsNone(result)
149152

153+
@unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON")
150154
def test_is_package(self):
151155
# Should be able to tell what is a package.
152156
test_for = (('__hello__', False), ('__phello__', True),

Lib/test/test_importlib/resources/test_files.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ class OpenDiskTests(FilesTests, unittest.TestCase):
5252
def setUp(self):
5353
self.data = data01
5454

55+
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
56+
def test_read_bytes(self):
57+
super().test_read_bytes()
58+
5559

5660
class OpenZipTests(FilesTests, util.ZipSetup, unittest.TestCase):
5761
pass
@@ -63,6 +67,9 @@ def setUp(self):
6367

6468
self.data = namespacedata01
6569

70+
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
71+
def test_read_bytes(self):
72+
super().test_read_bytes()
6673

6774
class SiteDir:
6875
def setUp(self):

Lib/test/test_importlib/source/test_finder.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ def test_no_read_directory(self):
168168
found = self._find(finder, 'doesnotexist')
169169
self.assertEqual(found, self.NOT_FOUND)
170170

171-
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
172171
def test_ignore_file(self):
173172
# If a directory got changed to a file from underneath us, then don't
174173
# worry about looking for submodules.

vm/src/exceptions.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,9 @@ fn write_traceback_entry<W: Write>(
374374
writeln!(
375375
output,
376376
r##" File "{}", line {}, in {}"##,
377-
filename, tb_entry.lineno, tb_entry.frame.code.obj_name
377+
filename.trim_start_matches(r"\\?\"),
378+
tb_entry.lineno,
379+
tb_entry.frame.code.obj_name
378380
)?;
379381
print_source_line(output, filename, tb_entry.lineno.to_usize())?;
380382

0 commit comments

Comments
 (0)
0