Skip tests that pollute the execution environment for some reason · RustPython/RustPython@7bf9c34 · GitHub
Skip to content

Commit 7bf9c34

Browse files
committed
Skip tests that pollute the execution environment for some reason
1 parent d872068 commit 7bf9c34

7 files changed

Lines changed: 74 additions & 2 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 47 additions & 0 deletions

Lib/test/test_file_eintr.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ def test_readall(self):
186186
class CTestFileIOSignalInterrupt(TestFileIOSignalInterrupt, unittest.TestCase):
187187
modname = '_io'
188188

189+
@unittest.skipIf(
190+
'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ,
191+
"TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unknown reason"
192+
)
189193
# TODO: RUSTPYTHON - _io.FileIO.readall uses read_to_end which differs from _pyio.FileIO.readall
190194
@unittest.expectedFailure
191195
def test_readall(self):

Lib/test/test_importlib/resources/test_resource.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ def test_is_file_failure_does_not_keep_open(self):
192192
def test_as_file_does_not_keep_open(self): # pragma: no cover
193193
resources.as_file(resources.files('ziptestdata') / 'binary.file')
194194

195+
import os # TODO: RUSTPYTHON see below
196+
@unittest.skipIf(
197+
'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ,
198+
"TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to tmpfile leak"
199+
)
195200
def test_entered_path_does_not_keep_open(self):
196201
"""
197202
Mimic what certifi does on import to make its bundle

Lib/test/test_raise.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,11 @@ def f():
464464

465465
f()
466466

467+
import os # TODO: RUSTPYTHON see below
468+
@unittest.skipIf(
469+
'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ,
470+
"TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unraisable exception"
471+
)
467472
def test_3611(self):
468473
import gc
469474
# A re-raised exception in a __del__ caused the __context__

Lib/test/test_ssl.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4299,6 +4299,10 @@ def cb_returning_alert(ssl_sock, server_name, initial_context):
42994299
sni_name='supermessage')
43004300
self.assertEqual(cm.exception.reason, 'TLSV1_ALERT_ACCESS_DENIED')
43014301

4302+
@unittest.skipIf(
4303+
'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ,
4304+
"TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unraisable exception"
4305+
)
43024306
@unittest.expectedFailure # TODO: RUSTPYTHON
43034307
def test_sni_callback_raising(self):
43044308
# Raising fails the connection with a TLS handshake failure alert.

Lib/test/test_subprocess.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,8 +1292,10 @@ def test_universal_newlines_communicate_stdin_stdout_stderr(self):
12921292
# to stderr at exit of subprocess.
12931293
self.assertTrue(stderr.startswith("eline2\neline6\neline7\n"))
12941294

1295-
# TODO: RUSTPYTHON
1296-
@unittest.expectedFailure
1295+
@unittest.skipIf(
1296+
'RUSTPYTHON_SKIP_ENV_POLLUTERS' in os.environ,
1297+
"TODO: RUSTPYTHON environment pollution when running rustpython -m test --fail-env-changed due to unknown reason"
1298+
)
12971299
def test_universal_newlines_communicate_encodings(self):
12981300
# Check that universal newlines mode works for various encodings,
12991301
# in particular for encodings in the UTF-16 and UTF-32 families.

Lib/test/test_sys.py

Lines changed: 5 additions & 0 deletions

0 commit comments

Comments
 (0)