Skip to content

Commit be513cb

Browse files
Add skips
1 parent 57d3520 commit be513cb

22 files changed

+153
-18
lines changed

Lib/test/support/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,10 @@ def requires_zlib(reason='requires zlib'):
497497
try:
498498
import zlib
499499
except ImportError:
500-
zlib = None
501-
return unittest.skipUnless(zlib, reason)
500+
if sys.platform.startswith('wasi'):
501+
zlib = None
502+
return unittest.skipUnless(zlib, reason)
503+
raise
502504

503505
def requires_gzip(reason='requires gzip'):
504506
try:

Lib/test/test_bdb.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
from test.support import import_helper
6161
from test.support import os_helper
6262
from test.support import patch_list
63+
from test.support import requires_zlib
6364

6465

6566
class BdbException(Exception): pass
@@ -634,6 +635,7 @@ def test_next(self):
634635
with TracerRun(self) as tracer:
635636
tracer.runcall(tfunc_main)
636637

638+
@requires_zlib
637639
def test_next_over_import(self):
638640
code = """
639641
def main():
@@ -729,6 +731,7 @@ def test_until_in_caller_frame(self):
729731
tracer.runcall(tfunc_main)
730732

731733
@patch_list(sys.meta_path)
734+
@requires_zlib
732735
def test_skip(self):
733736
# Check that tracing is skipped over the import statement in
734737
# 'tfunc_import()'.
@@ -789,6 +792,7 @@ def test_bp_on_non_existent_module(self):
789792
with TracerRun(self) as tracer:
790793
self.assertRaises(BdbError, tracer.runcall, tfunc_import)
791794

795+
@requires_zlib
792796
def test_bp_after_last_statement(self):
793797
code = """
794798
def main():
@@ -802,6 +806,7 @@ def main():
802806
with TracerRun(self) as tracer:
803807
self.assertRaises(BdbError, tracer.runcall, tfunc_import)
804808

809+
@requires_zlib
805810
def test_temporary_bp(self):
806811
code = """
807812
def func():
@@ -853,6 +858,7 @@ def main():
853858
with TracerRun(self) as tracer:
854859
tracer.runcall(tfunc_import)
855860

861+
@requires_zlib
856862
def test_bp_condition(self):
857863
code = """
858864
def func(a):
@@ -873,6 +879,7 @@ def main():
873879
with TracerRun(self) as tracer:
874880
tracer.runcall(tfunc_import)
875881

882+
@requires_zlib
876883
def test_bp_exception_on_condition_evaluation(self):
877884
code = """
878885
def func(a):
@@ -892,6 +899,7 @@ def main():
892899
with TracerRun(self) as tracer:
893900
tracer.runcall(tfunc_import)
894901

902+
@requires_zlib
895903
def test_bp_ignore_count(self):
896904
code = """
897905
def func():
@@ -913,6 +921,7 @@ def main():
913921
with TracerRun(self) as tracer:
914922
tracer.runcall(tfunc_import)
915923

924+
@requires_zlib
916925
def test_ignore_count_on_disabled_bp(self):
917926
code = """
918927
def func():
@@ -940,6 +949,7 @@ def main():
940949
with TracerRun(self) as tracer:
941950
tracer.runcall(tfunc_import)
942951

952+
@requires_zlib
943953
def test_clear_two_bp_on_same_line(self):
944954
code = """
945955
def func():
@@ -1030,6 +1040,7 @@ def test_run_step(self):
10301040
with TracerRun(self) as tracer:
10311041
tracer.run(compile(textwrap.dedent(code), '<string>', 'exec'))
10321042

1043+
@requires_zlib
10331044
def test_runeval_step(self):
10341045
# Test bdb 'runeval'.
10351046
code = """
@@ -1053,6 +1064,7 @@ def main():
10531064
class IssuesTestCase(BaseTestCase):
10541065
"""Test fixed bdb issues."""
10551066

1067+
@requires_zlib
10561068
def test_step_at_return_with_no_trace_in_caller(self):
10571069
# Issue #13183.
10581070
# Check that the tracer does step into the caller frame when the
@@ -1083,6 +1095,7 @@ def func():
10831095
with TracerRun(self) as tracer:
10841096
tracer.runcall(tfunc_import)
10851097

1098+
@requires_zlib
10861099
def test_next_until_return_in_generator(self):
10871100
# Issue #16596.
10881101
# Check that set_next(), set_until() and set_return() do not treat the
@@ -1124,6 +1137,7 @@ def main():
11241137
with TracerRun(self) as tracer:
11251138
tracer.runcall(tfunc_import)
11261139

1140+
@requires_zlib
11271141
def test_next_command_in_generator_for_loop(self):
11281142
# Issue #16596.
11291143
code = """
@@ -1155,6 +1169,7 @@ def main():
11551169
with TracerRun(self) as tracer:
11561170
tracer.runcall(tfunc_import)
11571171

1172+
@requires_zlib
11581173
def test_next_command_in_generator_with_subiterator(self):
11591174
# Issue #16596.
11601175
code = """
@@ -1186,6 +1201,7 @@ def main():
11861201
with TracerRun(self) as tracer:
11871202
tracer.runcall(tfunc_import)
11881203

1204+
@requires_zlib
11891205
def test_return_command_in_generator_with_subiterator(self):
11901206
# Issue #16596.
11911207
code = """

0 commit comments

Comments
 (0)