[pypy-commit] pypy py3.6: enable _io own tests on windows
mattip
pypy.commits at gmail.com
Mon Sep 16 10:19:49 EDT 2019
Author: Matti Picus <matti.picus at gmail.com>
Branch: py3.6
Changeset: r97494:b6cec0565e9d
Date: 2019-09-16 16:28 +0300
http://bitbucket.org/pypy/pypy/changeset/b6cec0565e9d/
Log: enable _io own tests on windows
diff --git a/pypy/module/_io/test/test_bufferedio.py b/pypy/module/_io/test/test_bufferedio.py
--- a/pypy/module/_io/test/test_bufferedio.py
+++ b/pypy/module/_io/test/test_bufferedio.py
@@ -8,8 +8,10 @@
class AppTestBufferedReader:
- spaceconfig = dict(usemodules=['_io', 'fcntl'])
-
+ spaceconfig = dict(usemodules=['_io'])
+ if os.name != 'nt':
+ spaceconfig['usemodules'].append('fcntl')
+
def setup_class(cls):
tmpfile = udir.join('tmpfile')
tmpfile.write("a\nb\nc", mode='wb')
@@ -388,7 +390,10 @@
def test_readline_issue3042(self):
import _io as io
- import fcntl
+ try:
+ import fcntl
+ except ImportError:
+ skip('fcntl missing')
fdin, fdout = self.posix.pipe()
f = io.open(fdin, "rb")
fl = fcntl.fcntl(f, fcntl.F_GETFL)
@@ -400,7 +405,10 @@
class AppTestBufferedReaderWithThreads(AppTestBufferedReader):
- spaceconfig = dict(usemodules=['_io', 'fcntl', 'thread', 'time'])
+ spaceconfig = dict(usemodules=['_io', 'thread', 'time'])
+ if os.name != 'nt':
+ spaceconfig['usemodules'].append('fcntl')
+
def test_readinto_small_parts(self):
import _io, os, _thread, time
diff --git a/pypy/module/_io/test/test_fileio.py b/pypy/module/_io/test/test_fileio.py
--- a/pypy/module/_io/test/test_fileio.py
+++ b/pypy/module/_io/test/test_fileio.py
@@ -5,8 +5,9 @@
class AppTestFileIO:
- spaceconfig = dict(usemodules=['_io', 'array'] +
- (['fcntl'] if os.name != 'nt' else []))
+ spaceconfig = dict(usemodules=['_io', 'array'])
+ if os.name != 'nt':
+ spaceconfig['usemodules'].append('fcntl')
def setup_method(self, meth):
tmpfile = udir.join('tmpfile')
More information about the pypy-commit
mailing list