Skip to content

Commit 44638b9

Browse files
authored
Run skipped test on Python 3.13 (#145)
Now that CPython 3.13.1 is released
1 parent 9c45bdd commit 44638b9

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

tests/test_argparse.py

+16-8
Original file line numberDiff line numberDiff line change
@@ -1073,11 +1073,8 @@ def test_arg_default_spans():
10731073
assert help_text == clean(expected_help_text)
10741074

10751075

1076-
@pytest.mark.skipif(
1077-
sys.version_info >= (3, 13), reason="Mut ex group usage wrapping broken in Python 3.13+"
1078-
) # CPython issue 121151 (https://github.com/python/cpython/issues/121151)
10791076
@pytest.mark.usefixtures("force_color")
1080-
def test_metavar_spans(): # pragma: <3.13 cover
1077+
def test_metavar_spans():
10811078
# tests exotic metavars (tuples, wrapped, different nargs, etc.) in usage and help text
10821079
parser = argparse.ArgumentParser(
10831080
prog="PROG", formatter_class=lambda prog: RichHelpFormatter(prog, width=20)
@@ -1096,9 +1093,17 @@ def test_metavar_spans(): # pragma: <3.13 cover
10961093
if sys.version_info < (3, 9): # pragma: <3.9 cover
10971094
op3_metavar = f"[\x1b[38;5;36mOP3\x1b[0m {op3_metavar}]"
10981095

1099-
expected_help_text = f"""\
1100-
\x1b[38;5;208mUsage:\x1b[0m \x1b[38;5;244mPROG\x1b[0m [\x1b[36m-h\x1b[0m]
1101-
[\x1b[36m--op1\x1b[0m [\x1b[38;5;36mMET\x1b[0m]
1096+
if sys.version_info >= (3, 13): # pragma: >=3.13 cover
1097+
usage_tail = """ |
1098+
\x1b[36m--op2\x1b[0m [\x1b[38;5;36mMET1\x1b[0m [\x1b[38;5;36mMET2\x1b[0m \x1b[38;5;36m...\x1b[0m]] |
1099+
\x1b[36m--op3\x1b[0m [\x1b[38;5;36mOP3\x1b[0m \x1b[38;5;36m...\x1b[0m] |
1100+
\x1b[36m--op4\x1b[0m \x1b[38;5;36mMET1\x1b[0m [\x1b[38;5;36mMET2\x1b[0m \x1b[38;5;36m...\x1b[0m] |
1101+
\x1b[36m--op5\x1b[0m \x1b[38;5;36mOP5\x1b[0m [\x1b[38;5;36mOP5\x1b[0m \x1b[38;5;36m...\x1b[0m] |
1102+
\x1b[36m--op6\x1b[0m \x1b[38;5;36mOP6\x1b[0m \x1b[38;5;36mOP6\x1b[0m \x1b[38;5;36mOP6\x1b[0m |
1103+
\x1b[36m--op7\x1b[0m \x1b[38;5;36mMET1\x1b[0m \x1b[38;5;36mMET2\x1b[0m \x1b[38;5;36mMET3\x1b[0m]
1104+
"""
1105+
else: # pragma: <3.13 cover
1106+
usage_tail = f"""
11021107
| \x1b[36m--op2\x1b[0m
11031108
[\x1b[38;5;36mMET1\x1b[0m [\x1b[38;5;36mMET2\x1b[0m \x1b[38;5;36m...\x1b[0m]]
11041109
| \x1b[36m--op3\x1b[0m
@@ -1116,7 +1121,10 @@ def test_metavar_spans(): # pragma: <3.13 cover
11161121
\x1b[38;5;36mMET1\x1b[0m
11171122
\x1b[38;5;36mMET2\x1b[0m
11181123
\x1b[38;5;36mMET3\x1b[0m]
1119-
1124+
"""
1125+
expected_help_text = f"""\
1126+
\x1b[38;5;208mUsage:\x1b[0m \x1b[38;5;244mPROG\x1b[0m [\x1b[36m-h\x1b[0m]
1127+
[\x1b[36m--op1\x1b[0m [\x1b[38;5;36mMET\x1b[0m]{usage_tail}
11201128
\x1b[38;5;208mOptional Arguments:\x1b[0m
11211129
\x1b[36m-h\x1b[0m, \x1b[36m--help\x1b[0m
11221130
\x1b[39mshow this help\x1b[0m

0 commit comments

Comments
 (0)