Skip to content

Commit b597343

Browse files
committed
Fix tests failing on Windows for Python 3.14
1 parent e8e221f commit b597343

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
- Breaking Change
44
- `cmd2` 2.6 supports Python 3.9+ (removed support for Python 3.8)
55
- Enhancements
6-
- Add testing support for Python 3.14
6+
- Add support for Python 3.14
77

88
## 2.5.11 (January 25, 2025)
99

cmd2/argparse_custom.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,6 @@ def __init__(
12651265
behavior on this parser. If this is None or not present, then cmd2 will use
12661266
argparse_completer.DEFAULT_AP_COMPLETER when tab completing this parser's arguments
12671267
"""
1268-
# TODO: CHANGE so if Python >= 3.14 new args are passed
12691268
if sys.version_info[1] >= 14:
12701269
# Python >= 3.14 so pass new arguments to parent argparse.ArgumentParser class
12711270
super(Cmd2ArgumentParser, self).__init__(

tests/test_history.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ def test_history_verbose_with_other_options(base_app):
772772
options_to_test = ['-r', '-e', '-o file', '-t file', '-c', '-x']
773773
for opt in options_to_test:
774774
out, err = run_cmd(base_app, 'history -v ' + opt)
775-
assert len(out) == 4
775+
assert len(out) >= 4
776776
assert out[0] == '-v cannot be used with any other options'
777777
assert out[1].startswith('Usage:')
778778
assert base_app.last_result is False
@@ -800,7 +800,7 @@ def test_history_script_with_invalid_options(base_app):
800800
options_to_test = ['-r', '-e', '-o file', '-t file', '-c']
801801
for opt in options_to_test:
802802
out, err = run_cmd(base_app, 'history -s ' + opt)
803-
assert len(out) == 4
803+
assert len(out) >= 4
804804
assert out[0] == '-s and -x cannot be used with -c, -r, -e, -o, or -t'
805805
assert out[1].startswith('Usage:')
806806
assert base_app.last_result is False
@@ -820,7 +820,7 @@ def test_history_expanded_with_invalid_options(base_app):
820820
options_to_test = ['-r', '-e', '-o file', '-t file', '-c']
821821
for opt in options_to_test:
822822
out, err = run_cmd(base_app, 'history -x ' + opt)
823-
assert len(out) == 4
823+
assert len(out) >= 4
824824
assert out[0] == '-s and -x cannot be used with -c, -r, -e, -o, or -t'
825825
assert out[1].startswith('Usage:')
826826
assert base_app.last_result is False

0 commit comments

Comments
 (0)