aboutsummaryrefslogtreecommitdiff
path: root/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests.py')
-rwxr-xr-xtests.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests.py b/tests.py
index 33c9f6d..32511c8 100755
--- a/tests.py
+++ b/tests.py
@@ -106,7 +106,7 @@ def test_json_post_posts():
j = r.json()
assert len(j) == 1
- assert "title" == j[0]["title"]
+ assert "title" == j[0]["title"]
assert "body" == j[0]["body"]
url = f"{BASE_URL}/posts/{uuid_}"
@@ -115,7 +115,7 @@ def test_json_post_posts():
j = r.json()
assert len(j) == 1
- assert "title" == j[0]["title"]
+ assert "title" == j[0]["title"]
assert "body" == j[0]["body"]
@@ -136,11 +136,17 @@ def test_json_get_post_not_found():
def main():
+ winner = True
for func in dir(sys.modules[__name__]):
if func.startswith("test_"):
- globals()[func]()
-
- print("🏆 You're winner !")
+ try:
+ globals()[func]()
+ except Exception:
+ winner = False
+ print(f"{func} failed.")
+
+ if winner:
+ print("🏆 You're winner !")
if __name__ == "__main__":