diff options
author | Michael McVady <femtonaut@gmail.com> | 2023-01-07 14:28:48 -0600 |
---|---|---|
committer | Michael McVady <femtonaut@gmail.com> | 2023-01-07 14:28:48 -0600 |
commit | 176668c4a1e7c949cbdb4ba387b7f187701e8db5 (patch) | |
tree | 0e7a433965c565db366e10e74531c522968b2593 /tests.py | |
parent | 850df3b8721963b6fefc226b533c347cde79ff25 (diff) |
Start refactor
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__": |