chore: improve cmd2 maintenance path - #1669
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1669 +/- ##
==========================================
- Coverage 99.53% 99.53% -0.01%
==========================================
Files 22 22
Lines 4928 4903 -25
==========================================
- Hits 4905 4880 -25
Misses 23 23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
| def __init__( | ||
| self, | ||
| inner_stream: Union[TextIO, "StdSim"], | ||
| inner_stream: TextIO | "StdSim", |
There was a problem hiding this comment.
For the upcoming cmd2 4.0.0 release we support Python versions 3.11 or newer.
Using the | operator with a forward-declaration string type works with Python 3.14+, but does not work with older versions of Python, hence the Union is still required for forward declaration types.
|
Closing this AI-generated PR. |
| def test_to_bool_empty() -> None: | ||
| with pytest.raises(ValueError): | ||
| cu.to_bool("") | ||
|
|
||
|
|
||
| def test_to_bool_whitespace() -> None: | ||
| with pytest.raises(ValueError): | ||
| cu.to_bool(" ") | ||
| with pytest.raises(ValueError): | ||
| cu.to_bool("\t") | ||
| with pytest.raises(ValueError): | ||
| cu.to_bool("\n") | ||
|
|
||
|
|
||
| def test_to_bool_none() -> None: | ||
| assert not cu.to_bool(None) | ||
|
|
||
|
|
There was a problem hiding this comment.
All of this could've been a loop over a list of checks.
Summary:
Notes: