ソースを参照

Merge pull request #7682 from ThomasWaldmann/test-cosmetics-1.2

tests: avoid long ids in pytest output
TW 1 年間 前
コミット
edc9a0843a

+ 2 - 1
src/borg/testsuite/archive.py

@@ -245,7 +245,8 @@ IK = sorted(list(ITEM_KEYS))
         {b'path': b'/a/b/c'},  # small (different msgpack mapping type!)
         OrderedDict((k, b'') for k in IK),  # as big (key count) as it gets
         OrderedDict((k, b'x' * 1000) for k in IK),  # as big (key count and volume) as it gets
-    ]])
+    ]],
+    ids=["minimal", "empty-values", "long-values"])
 def test_valid_msgpacked_items(packed, item_keys_serialized):
     assert valid_msgpacked_dict(packed, item_keys_serialized)
 

+ 3 - 2
src/borg/testsuite/archiver.py

@@ -4789,6 +4789,7 @@ def test_help_formatting(command, parser):
         assert parser.epilog.rst
 
 
-@pytest.mark.parametrize('topic, helptext', list(Archiver.helptext.items()))
-def test_help_formatting_helptexts(topic, helptext):
+@pytest.mark.parametrize('topic', list(Archiver.helptext.keys()))
+def test_help_formatting_helptexts(topic):
+    helptext = Archiver.helptext[topic]
     assert str(rst_to_terminal(helptext))

+ 1 - 1
src/borg/testsuite/cache.py

@@ -117,7 +117,7 @@ class TestCacheSynchronizer:
         (True, 'Unexpected object: true'),
         (False, 'Unexpected object: false'),
         (None, 'Unexpected object: nil'),
-    ))
+    ), ids=["map", "bytes", "int", "double", "true", "false", "none"])
     @pytest.mark.parametrize('structure', (
         lambda elem: {'chunks': elem},
         lambda elem: {'chunks': [elem]},

+ 1 - 1
src/borg/testsuite/key.py

@@ -384,7 +384,7 @@ class TestTAM:
         (bytes(64), {}),
         (None, bytes(64)),
         (bytes(64), None),
-    ))
+    ), ids=["ed-b64", "b64-ed", "n-b64", "b64-n"])
     def test_wrong_types(self, key, hmac, salt):
         data = {
             'tam': {