Format and lint all test files
Marco Ricci

Marco Ricci commited on 2025-08-09 15:19:17
Zeige 5 geänderte Dateien mit 14 Einfügungen und 25 Löschungen.

... ...
@@ -1090,9 +1090,9 @@ def export_version_option_callback(
1090 1090
             # Marked as known-but-unavailable, because they are used by
1091 1091
             # subcommands of `derivepassphrase export`, not by the
1092 1092
             # command itself.
1093
-            _msg.Label.UNAVAILABLE_FOREIGN_CONFIGURATION_FORMATS: [
1094
-                k for k in foreign_configuration_formats
1095
-            ],
1093
+            _msg.Label.UNAVAILABLE_FOREIGN_CONFIGURATION_FORMATS: list(
1094
+                foreign_configuration_formats
1095
+            ),
1096 1096
             _msg.Label.SUPPORTED_SUBCOMMANDS: [
1097 1097
                 k for k in supported_subcommands if k.test()
1098 1098
             ],
... ...
@@ -113,10 +113,10 @@ _hypothesis_settings_setup()
113 113
 def pytest_configure(config: pytest.Config) -> None:
114 114
     """Configure `pytest`: add the `heavy_duty` marker."""
115 115
     config.addinivalue_line(
116
-        'markers',
116
+        "markers",
117 117
         (
118
-            'heavy_duty: '
119
-            'mark test as a slow, heavy-duty test (e.g., an integration test)'
118
+            "heavy_duty: "
119
+            "mark test as a slow, heavy-duty test (e.g., an integration test)"
120 120
         ),
121 121
     )
122 122
 
... ...
@@ -802,8 +802,8 @@ class FakeConfigurationMutexStateMachine(stateful.RuleBasedStateMachine):
802 802
             settings = FakeConfigurationMutexStateMachine.TestCase.settings
803 803
         except AttributeError:  # pragma: no cover
804 804
             settings = None
805
-        self.step_count = (
806
-            hypothesis_machinery.get_concurrency_step_count(settings)
805
+        self.step_count = hypothesis_machinery.get_concurrency_step_count(
806
+            settings
807 807
         )
808 808
 
809 809
     @stateful.initialize(
... ...
@@ -116,9 +116,7 @@ class Parametrize(types.SimpleNamespace):
116 116
         [
117 117
             None,
118 118
             pytest.param(data.VAULT_MASTER_KEY, id="str"),
119
-            pytest.param(
120
-                data.VAULT_MASTER_KEY.encode("ascii"), id="bytes"
121
-            ),
119
+            pytest.param(data.VAULT_MASTER_KEY.encode("ascii"), id="bytes"),
122 120
             pytest.param(
123 121
                 bytearray(data.VAULT_MASTER_KEY.encode("ascii")),
124 122
                 id="bytearray",
... ...
@@ -752,8 +750,7 @@ class TestVaultNativeConfig:
752 750
                 )
753 751
             )
754 752
             assert (
755
-                handler(path, key, format="v0.3")
756
-                == data.VAULT_V03_CONFIG_DATA
753
+                handler(path, key, format="v0.3") == data.VAULT_V03_CONFIG_DATA
757 754
             )
758 755
 
759 756
     @Parametrize.VAULT_NATIVE_PARSER_CLASS_DATA
... ...
@@ -659,9 +659,7 @@ class TestTestingMachineryStubbedSSHAgentSocket:
659 659
         query_response = b""
660 660
         with pytest.raises(
661 661
             ValueError,
662
-            match=re.escape(
663
-                machinery.StubbedSSHAgentSocket._SOCKET_IS_CLOSED
664
-            ),
662
+            match=re.escape(machinery.StubbedSSHAgentSocket._SOCKET_IS_CLOSED),
665 663
         ):
666 664
             agent.sendall(query_request)
667 665
         assert agent.recv(100) == query_response
... ...
@@ -800,16 +798,12 @@ class TestStaticFunctionality:
800 798
         """[`tests.parse_sh_export_line`][] works."""
801 799
         if value is not None:
802 800
             assert (
803
-                callables.parse_sh_export_line(
804
-                    line, env_name=env_name
805
-                )
801
+                callables.parse_sh_export_line(line, env_name=env_name)
806 802
                 == value
807 803
             )
808 804
         else:
809 805
             with pytest.raises(ValueError, match="Cannot parse sh line:"):
810
-                callables.parse_sh_export_line(
811
-                    line, env_name=env_name
812
-                )
806
+                callables.parse_sh_export_line(line, env_name=env_name)
813 807
 
814 808
     def test_200_constructor_posix_no_ssh_auth_sock(
815 809
         self,
... ...
@@ -1333,9 +1327,7 @@ class TestAgentInteraction:
1333 1327
 
1334 1328
         def key_is_suitable(key: bytes) -> bool:
1335 1329
             """Stub out [`vault.Vault.key_is_suitable`][]."""
1336
-            always = {
1337
-                v.public_key_data for v in data.SUPPORTED_KEYS.values()
1338
-            }
1330
+            always = {v.public_key_data for v in data.SUPPORTED_KEYS.values()}
1339 1331
             dsa = {
1340 1332
                 v.public_key_data
1341 1333
                 for k, v in data.UNSUITABLE_KEYS.items()
1342 1334