Combine the tests on normalized command-lines
Marco Ricci

Marco Ricci commited on 2026-08-19 21:25:51
Zeige 1 geänderte Dateien mit 5 Einfügungen und 6 Löschungen.


Both variants of the test for normalized command-lines are smoke tests
that the strategy and the parser step agree on the definition of
normalized command-lines.  Plus, they have the same test function
signature.  Why *not* combine them into a single test...?
... ...
@@ -1688,7 +1688,11 @@ class Test001VersionOutputParser:
1688 1688
 class Test010CLIMachinery:
1689 1689
     """Tests for the CLI machinery."""
1690 1690
 
1691
-    @hypothesis.given(starting_state=Strategies.parse_states(normalized=True))
1691
+    @hypothesis.given(
1692
+        starting_state=Strategies.parse_states(
1693
+            normalized=True, allow_eager=False
1694
+        )
1695
+    )
1692 1696
     def test_normalized_starting_states_are_normalized(
1693 1697
         self,
1694 1698
         starting_state: cli_machinery.ParseState,
... ...
@@ -1717,11 +1721,6 @@ class Test010CLIMachinery:
1717 1721
                     "in normalized command-line"
1718 1722
                 )
1719 1723
 
1720
-    @hypothesis.given(starting_state=Strategies.parse_states(normalized=True))
1721
-    def test_normalize_options_stage_on_normalized_command_lines(
1722
-        self,
1723
-        starting_state: cli_machinery.ParseState,
1724
-    ) -> None:
1725 1724
         result = cli_machinery.normalize_options(starting_state)
1726 1725
         assert result == cli_machinery.ParseResult.unit(starting_state)
1727 1726
 
1728 1727