summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-05-18 10:21:34 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-05-18 23:59:05 +0200
commit6b908313ef4b57c4b23bb49aec55c84ef981f949 (patch)
tree16ceb729304ce9c5250808410b7367cb03e2ea3c /test
parentc54cfef3968613f9e86e76a3337148360e20150e (diff)
downloadsystemd-6b908313ef4b57c4b23bb49aec55c84ef981f949.tar.gz
test/run-unit-tests: make script compatible with python3.6
dataclasses were added in python3.7, but bionic has python3.6. Yes, the new code is a travesty, but it does the job. Fixes #19640.
Diffstat (limited to 'test')
-rwxr-xr-xtest/run-unit-tests.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/test/run-unit-tests.py b/test/run-unit-tests.py
index f0dea5c07f..f4d290aa91 100755
--- a/test/run-unit-tests.py
+++ b/test/run-unit-tests.py
@@ -1,7 +1,6 @@
#!/usr/bin/env python3
import argparse
-import dataclasses
import glob
import os
import pathlib
@@ -17,12 +16,11 @@ try:
except ImportError:
GREEN = YELLOW = RED = RESET_ALL = BRIGHT = ''
-@dataclasses.dataclass
-class Total:
- total:int
- good:int = 0
- skip:int = 0
- fail:int = 0
+class total:
+ total = None
+ good = 0
+ skip = 0
+ fail = 0
def argument_parser():
p = argparse.ArgumentParser()
@@ -41,7 +39,7 @@ if opts.unsafe:
if not opts.artifact_directory and os.getenv('ARTIFACT_DIRECTORY'):
opts.artifact_directory = os.getenv('ARTIFACT_DIRECTORY')
-total = Total(total=len(tests))
+total.total = len(tests)
for test in tests:
name = os.path.basename(test)