Use Black stable to format python code
[babeltrace.git] / tests / utils / python / tap / tracker.py
index e9c7e1d4a8b3d2ab4b10882511148e14973e8c44..3f6826e3c03c7e1256bf3bea4d318982959e95e2 100644 (file)
@@ -13,10 +13,9 @@ from tap.line import Result
 
 
 class Tracker(object):
-
     def __init__(
-            self, outdir=None, combined=False, streaming=False, stream=None,
-            header=True):
+        self, outdir=None, combined=False, streaming=False, stream=None, header=True
+    ):
         self.outdir = outdir
 
         # Combine all the test results into one file.
@@ -66,23 +65,31 @@ class Tracker(object):
 
     def add_ok(self, class_name, description, directive=''):
         result = Result(
-            ok=True, number=self._get_next_line_number(class_name),
-            description=description, directive=Directive(directive))
+            ok=True,
+            number=self._get_next_line_number(class_name),
+            description=description,
+            directive=Directive(directive),
+        )
         self._add_line(class_name, result)
 
-    def add_not_ok(
-            self, class_name, description, directive='', diagnostics=None):
+    def add_not_ok(self, class_name, description, directive='', diagnostics=None):
         result = Result(
-            ok=False, number=self._get_next_line_number(class_name),
-            description=description, diagnostics=diagnostics,
-            directive=Directive(directive))
+            ok=False,
+            number=self._get_next_line_number(class_name),
+            description=description,
+            diagnostics=diagnostics,
+            directive=Directive(directive),
+        )
         self._add_line(class_name, result)
 
     def add_skip(self, class_name, description, reason):
         directive = 'SKIP {0}'.format(reason)
         result = Result(
-            ok=True, number=self._get_next_line_number(class_name),
-            description=description, directive=Directive(directive))
+            ok=True,
+            number=self._get_next_line_number(class_name),
+            description=description,
+            directive=Directive(directive),
+        )
         self._add_line(class_name, result)
 
     def _add_line(self, class_name, result):
@@ -122,9 +129,9 @@ class Tracker(object):
             with open(combined_file, 'w') as out_file:
                 for test_case in self.combined_test_cases_seen:
                     self.generate_tap_report(
-                        test_case, self._test_cases[test_case], out_file)
-                print(
-                    '1..{0}'.format(self.combined_line_number), file=out_file)
+                        test_case, self._test_cases[test_case], out_file
+                    )
+                print('1..{0}'.format(self.combined_line_number), file=out_file)
         else:
             for test_case, tap_lines in self._test_cases.items():
                 with open(self._get_tap_file_path(test_case), 'w') as out_file:
@@ -142,8 +149,9 @@ class Tracker(object):
             print('1..{0}'.format(len(tap_lines)), file=out_file)
 
     def _write_test_case_header(self, test_case, stream):
-        print(_('# TAP results for {test_case}').format(
-            test_case=test_case), file=stream)
+        print(
+            _('# TAP results for {test_case}').format(test_case=test_case), file=stream
+        )
 
     def _get_tap_file_path(self, test_case):
         """Get the TAP output file path for the test case."""
This page took 0.023718 seconds and 4 git commands to generate.