diff options
Diffstat (limited to 'tests.py')
-rwxr-xr-x | tests.py | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -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__": |