aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2019-07-20 13:18:25 +0200
committerIlya Etingof <etingof@gmail.com>2019-07-20 13:18:25 +0200
commit63a107fb8a330c58c259f4afe89397124ae29ef8 (patch)
treeec9934d014126b50bfec907a820c5875370bb843
parentb5eb18384659ef1da9f72158626c6779c1214679 (diff)
downloadpyasn1-modules-63a107fb8a330c58c259f4afe89397124ae29ef8.tar.gz
Unit tests runner returns proper error status to OS
-rw-r--r--tests/__main__.py5
-rw-r--r--tests/test_rfc2314.py5
-rw-r--r--tests/test_rfc2315.py6
-rw-r--r--tests/test_rfc2437.py5
-rw-r--r--tests/test_rfc2459.py6
-rw-r--r--tests/test_rfc2511.py5
-rw-r--r--tests/test_rfc2560.py5
-rw-r--r--tests/test_rfc2634.py5
-rw-r--r--tests/test_rfc2986.py5
-rw-r--r--tests/test_rfc3161.py5
-rw-r--r--tests/test_rfc3274.py6
-rw-r--r--tests/test_rfc3560.py5
-rw-r--r--tests/test_rfc3565.py5
-rw-r--r--tests/test_rfc3709.py5
-rw-r--r--tests/test_rfc3779.py5
-rw-r--r--tests/test_rfc4055.py5
-rw-r--r--tests/test_rfc4073.py5
-rw-r--r--tests/test_rfc4108.py5
-rw-r--r--tests/test_rfc4210.py5
-rw-r--r--tests/test_rfc5035.py5
-rw-r--r--tests/test_rfc5083.py5
-rw-r--r--tests/test_rfc5084.py5
-rw-r--r--tests/test_rfc5208.py5
-rw-r--r--tests/test_rfc5280.py5
-rw-r--r--tests/test_rfc5480.py8
-rw-r--r--tests/test_rfc5649.py5
-rw-r--r--tests/test_rfc5652.py5
-rw-r--r--tests/test_rfc5915.py5
-rw-r--r--tests/test_rfc5940.py5
-rw-r--r--tests/test_rfc5958.py5
-rw-r--r--tests/test_rfc6019.py5
-rw-r--r--tests/test_rfc7191.py5
-rw-r--r--tests/test_rfc7296.py5
-rw-r--r--tests/test_rfc8103.py5
-rw-r--r--tests/test_rfc8226.py6
-rw-r--r--tests/test_rfc8410.py5
-rw-r--r--tests/test_rfc8418.py5
-rw-r--r--tests/test_rfc8520.py5
-rw-r--r--tests/test_rfc8619.py5
39 files changed, 161 insertions, 41 deletions
diff --git a/tests/__main__.py b/tests/__main__.py
index 08b0424..bff38c4 100644
--- a/tests/__main__.py
+++ b/tests/__main__.py
@@ -53,4 +53,7 @@ suite = unittest.TestLoader().loadTestsFromNames(
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc2314.py b/tests/test_rfc2314.py
index 985e504..f303927 100644
--- a/tests/test_rfc2314.py
+++ b/tests/test_rfc2314.py
@@ -57,4 +57,7 @@ GGbx7DI=
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc2315.py b/tests/test_rfc2315.py
index e65ce80..f5837a7 100644
--- a/tests/test_rfc2315.py
+++ b/tests/test_rfc2315.py
@@ -162,7 +162,11 @@ Kv0xuR3b3Le+ZqolT8wQELd5Mmw5JPofZ+O2cGNvet8tYwOKFjEA
assert asn1Object.prettyPrint()
assert der_encoder.encode(asn1Object) == substrate
+
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc2437.py b/tests/test_rfc2437.py
index 7eaedd6..2490d10 100644
--- a/tests/test_rfc2437.py
+++ b/tests/test_rfc2437.py
@@ -47,4 +47,7 @@ n8lDw3JT6NjvMnD6aM8KBsLyhazWSVVkaUSqmJzgCF0=
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc2459.py b/tests/test_rfc2459.py
index e6335f4..4b54e44 100644
--- a/tests/test_rfc2459.py
+++ b/tests/test_rfc2459.py
@@ -137,8 +137,10 @@ INow2I3/ks+0MxDabTY=
assert der_encoder.encode(asn1Object) == substrate
-
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc2511.py b/tests/test_rfc2511.py
index 327b561..494d017 100644
--- a/tests/test_rfc2511.py
+++ b/tests/test_rfc2511.py
@@ -49,4 +49,7 @@ xfu5YVWi81/fw8QQ6X6YGHFQkomLd7jxakVyjxSng9BhO6GpjJNF
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc2560.py b/tests/test_rfc2560.py
index 79f8aad..fd6db37 100644
--- a/tests/test_rfc2560.py
+++ b/tests/test_rfc2560.py
@@ -81,4 +81,7 @@ HAESdf7nebz1wtqAOXE1jWF/y8g=
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc2634.py b/tests/test_rfc2634.py
index c024173..d57315b 100644
--- a/tests/test_rfc2634.py
+++ b/tests/test_rfc2634.py
@@ -178,4 +178,7 @@ lropBdPJ6jIXiZQgCwxbGTCwCMQClaQ9K+L5LTeuW50ZKSIbmBZQ5dxjtnK3OlS
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc2986.py b/tests/test_rfc2986.py
index 17d5daa..8f3e80a 100644
--- a/tests/test_rfc2986.py
+++ b/tests/test_rfc2986.py
@@ -89,4 +89,7 @@ fi6h7i9VVAZpslaKFfkNg12gLbbsCB1q36l5VXjHY/qe0FIUa9ogRrOi
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc3161.py b/tests/test_rfc3161.py
index cf26d5f..7068d5a 100644
--- a/tests/test_rfc3161.py
+++ b/tests/test_rfc3161.py
@@ -80,4 +80,7 @@ uuvuO3ZsRWuej+gso+nWi3CRnRc9Wb0++cq4s8YSLaYSj2pHMA==
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc3274.py b/tests/test_rfc3274.py
index 516884a..a8137fd 100644
--- a/tests/test_rfc3274.py
+++ b/tests/test_rfc3274.py
@@ -71,7 +71,11 @@ XQ7u2qbaKFtZ7V96NH8ApkUFkg==
assert cd['compressionAlgorithm']['algorithm'] == rfc3274.id_alg_zlibCompress
assert cd['encapContentInfo']['eContentType'] == rfc5652.id_data
+
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc3560.py b/tests/test_rfc3560.py
index 33291d5..112381a 100644
--- a/tests/test_rfc3560.py
+++ b/tests/test_rfc3560.py
@@ -72,4 +72,7 @@ class OAEPFullTestCase(unittest.TestCase):
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc3565.py b/tests/test_rfc3565.py
index aa16134..99cb567 100644
--- a/tests/test_rfc3565.py
+++ b/tests/test_rfc3565.py
@@ -54,4 +54,7 @@ class AESCBCTestCase(unittest.TestCase):
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite) \ No newline at end of file
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc3709.py b/tests/test_rfc3709.py
index 7d9b54f..a7d0ef8 100644
--- a/tests/test_rfc3709.py
+++ b/tests/test_rfc3709.py
@@ -82,4 +82,7 @@ Pj22pmfmQi5w21UljqoTj/+lQLkU3wfy5BdVKBwI0GfEA+YL3ctSzPNqAA==
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc3779.py b/tests/test_rfc3779.py
index eb2a2df..081f69b 100644
--- a/tests/test_rfc3779.py
+++ b/tests/test_rfc3779.py
@@ -94,4 +94,7 @@ V+vo2L72yerdbsP9xjqvhZrLKfsLZjYK4SdYYthi
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc4055.py b/tests/test_rfc4055.py
index c5609c9..93296c9 100644
--- a/tests/test_rfc4055.py
+++ b/tests/test_rfc4055.py
@@ -104,4 +104,7 @@ class OAEPFullTestCase(unittest.TestCase):
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc4073.py b/tests/test_rfc4073.py
index f600920..34cebea 100644
--- a/tests/test_rfc4073.py
+++ b/tests/test_rfc4073.py
@@ -150,4 +150,7 @@ buWO3egPDL8Kf7tBhzjIKLw=
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc4108.py b/tests/test_rfc4108.py
index c611b0e..aa5dfd2 100644
--- a/tests/test_rfc4108.py
+++ b/tests/test_rfc4108.py
@@ -111,4 +111,7 @@ dsnhVtIdkPtfJIvcYteYJg==
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc4210.py b/tests/test_rfc4210.py
index 0e78b9a..b3862e3 100644
--- a/tests/test_rfc4210.py
+++ b/tests/test_rfc4210.py
@@ -129,4 +129,7 @@ JA5RSwQoMDYTj2WrwtM/nsP12T39or4JRZhlLSM43IaTwEBtQw==
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc5035.py b/tests/test_rfc5035.py
index 1c605bc..b031c1b 100644
--- a/tests/test_rfc5035.py
+++ b/tests/test_rfc5035.py
@@ -177,4 +177,7 @@ vFIgX7eIkd8=
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc5083.py b/tests/test_rfc5083.py
index 5e3b47f..a1222f9 100644
--- a/tests/test_rfc5083.py
+++ b/tests/test_rfc5083.py
@@ -96,4 +96,7 @@ IDAeDBFXYXRzb24sIGNvbWUgaGVyZQYJKoZIhvcNAQcB
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc5084.py b/tests/test_rfc5084.py
index dae84b4..8356f90 100644
--- a/tests/test_rfc5084.py
+++ b/tests/test_rfc5084.py
@@ -51,4 +51,7 @@ class GCMParametersTestCase(unittest.TestCase):
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc5208.py b/tests/test_rfc5208.py
index 71d14b6..7e962ca 100644
--- a/tests/test_rfc5208.py
+++ b/tests/test_rfc5208.py
@@ -74,4 +74,7 @@ dLsZjNQ=
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc5280.py b/tests/test_rfc5280.py
index f17178f..5abff3e 100644
--- a/tests/test_rfc5280.py
+++ b/tests/test_rfc5280.py
@@ -231,4 +231,7 @@ FDASgAEBoQ0TC1N0ZXZlIEtpbGxl
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc5480.py b/tests/test_rfc5480.py
index 7af8944..23d227a 100644
--- a/tests/test_rfc5480.py
+++ b/tests/test_rfc5480.py
@@ -61,8 +61,12 @@ Ea8/B6hPatJ0ES8q/HO3X8IVQwVs1n3aAr0im0/T+Xc=
param, rest = der_decoder.decode(algid['parameters'], asn1Spec=rfc5480.ECParameters())
assert param.prettyPrint()
assert param['namedCurve'] == rfc5480.secp384r1
-
+
+
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc5649.py b/tests/test_rfc5649.py
index d1b9f33..9f404ad 100644
--- a/tests/test_rfc5649.py
+++ b/tests/test_rfc5649.py
@@ -53,4 +53,7 @@ class AESKeyWrapWithPadTestCase(unittest.TestCase):
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc5652.py b/tests/test_rfc5652.py
index 1a04970..11132f2 100644
--- a/tests/test_rfc5652.py
+++ b/tests/test_rfc5652.py
@@ -170,4 +170,7 @@ xicQmJP+VoMHo/ZpjFY9fYCjNZUArgKsEwK/s+p9yrVVeB1Nf8Mn
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc5915.py b/tests/test_rfc5915.py
index 1c581e1..bcb8198 100644
--- a/tests/test_rfc5915.py
+++ b/tests/test_rfc5915.py
@@ -45,4 +45,7 @@ yDYOFDuqz/C2jyEwqgWCRyxyohuJXtk=
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc5940.py b/tests/test_rfc5940.py
index 9feeedf..d33a1c7 100644
--- a/tests/test_rfc5940.py
+++ b/tests/test_rfc5940.py
@@ -129,4 +129,7 @@ ttTMEpl2prH8bbwo1g==
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc5958.py b/tests/test_rfc5958.py
index 88fb4f1..febec78 100644
--- a/tests/test_rfc5958.py
+++ b/tests/test_rfc5958.py
@@ -77,4 +77,7 @@ YWlyc4EhABm/RAlphM3+hUG6wWfcO5bIUIaqMLa2ywxcOK1wMWbh
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc6019.py b/tests/test_rfc6019.py
index f66c12c..311e49f 100644
--- a/tests/test_rfc6019.py
+++ b/tests/test_rfc6019.py
@@ -59,4 +59,7 @@ class BinarySigningTimeTestCase(unittest.TestCase):
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc7191.py b/tests/test_rfc7191.py
index 36103bb..337bd44 100644
--- a/tests/test_rfc7191.py
+++ b/tests/test_rfc7191.py
@@ -290,4 +290,7 @@ iNF8uKtW/lk0AjA7z2q40N0lamXkSU7ECasiWOYV1X4cWGiQwMZDKknBPDqXqB6Es6p4J+qe
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc7296.py b/tests/test_rfc7296.py
index 90dc0a3..bcd28ee 100644
--- a/tests/test_rfc7296.py
+++ b/tests/test_rfc7296.py
@@ -161,4 +161,7 @@ m9Y=
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc8103.py b/tests/test_rfc8103.py
index 5bbdc03..921b9db 100644
--- a/tests/test_rfc8103.py
+++ b/tests/test_rfc8103.py
@@ -43,6 +43,9 @@ class CAEADChaCha20Poly1305TestCase(unittest.TestCase):
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc8226.py b/tests/test_rfc8226.py
index 19e7fc7..69fd438 100644
--- a/tests/test_rfc8226.py
+++ b/tests/test_rfc8226.py
@@ -86,7 +86,11 @@ yEFWA6G95b/HbtPMTjLpPKtrOjhofc4LyVCDYhFhKzpvHh1qeA==
if extn['extnID'] == rfc8226.id_pe_TNAuthList:
assert extnValue[0]['spc'] == 'fake'
+
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc8410.py b/tests/test_rfc8410.py
index 7c74175..e37bad0 100644
--- a/tests/test_rfc8410.py
+++ b/tests/test_rfc8410.py
@@ -41,4 +41,7 @@ class PrivateKeyTestCase(unittest.TestCase):
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc8418.py b/tests/test_rfc8418.py
index b0dbb7d..46ac689 100644
--- a/tests/test_rfc8418.py
+++ b/tests/test_rfc8418.py
@@ -40,4 +40,7 @@ class KeyAgreeAlgTestCase(unittest.TestCase):
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc8520.py b/tests/test_rfc8520.py
index 2a58ba9..483b81a 100644
--- a/tests/test_rfc8520.py
+++ b/tests/test_rfc8520.py
@@ -100,4 +100,7 @@ izaUuU1EEwgOMELjeFL62Ssvq8X+x6hZFCLygI7GNeitlblNhCXhFFurqMs=
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())
diff --git a/tests/test_rfc8619.py b/tests/test_rfc8619.py
index b030a38..05eee6a 100644
--- a/tests/test_rfc8619.py
+++ b/tests/test_rfc8619.py
@@ -79,4 +79,7 @@ class HKDFSHA512TestCase(unittest.TestCase):
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite)
+ import sys
+
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ sys.exit(not result.wasSuccessful())