Get regrtests working on Windows

This commit is contained in:
Noah
2020-02-28 11:21:44 -06:00
parent db65c8d512
commit 6b580c5921
4 changed files with 8 additions and 5 deletions

7
Lib/platform.py vendored
View File

@@ -281,9 +281,10 @@ def _syscmd_ver(system='', release='', version='',
for cmd in ('ver', 'command /c ver', 'cmd /c ver'):
try:
info = subprocess.check_output(cmd,
stderr=subprocess.DEVNULL,
text=True,
shell=True)
stderr=subprocess.DEVNULL,)
# XXX RustPython TODO: more Popen args
# text=True,
# shell=True)
except (OSError, subprocess.CalledProcessError) as why:
#print('Command %s failed: %s' % (cmd, why))
continue

View File

@@ -67,7 +67,7 @@ class CommonTest(seq_tests.CommonTest):
self.assertEqual(repr(a2), "[0, 1, 2, [...], 3]")
# TODO: RUSTPYTHON
@unittest.expectedFailure
@unittest.skip("TODO: RUSTPYTHON")
def test_repr_deep(self):
a = self.type2test([])
for i in range(sys.getrecursionlimit() + 100):

View File

@@ -558,7 +558,7 @@ class DictTest(unittest.TestCase):
self.assertRaises(Exc, repr, d)
# TODO: RUSTPYTHON
@unittest.expectedFailure
@unittest.skip("TODO: RUSTPYTHON")
def test_repr_deep(self):
d = {}
for i in range(sys.getrecursionlimit() + 100):

View File

@@ -248,6 +248,7 @@ pub fn make_module(vm: &VirtualMachine) -> PyObjectRef {
let subprocess_error = ctx.new_class("SubprocessError", ctx.exceptions.exception_type.clone());
let timeout_expired = ctx.new_class("TimeoutExpired", subprocess_error.clone());
let called_process_error = ctx.new_class("CalledProcessError", subprocess_error.clone());
let popen = py_class!(ctx, "Popen", ctx.object(), {
(slot new) => PopenRef::new,
@@ -270,6 +271,7 @@ pub fn make_module(vm: &VirtualMachine) -> PyObjectRef {
"Popen" => popen,
"SubprocessError" => subprocess_error,
"TimeoutExpired" => timeout_expired,
"CalledProcessError" => called_process_error,
"PIPE" => ctx.new_int(-1),
"STDOUT" => ctx.new_int(-2),
"DEVNULL" => ctx.new_int(-3),