Skip to content

Commit

Permalink
Improve error message for --json test case
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberw committed Aug 30, 2024
1 parent aba31d0 commit 4e29bf6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion locust/test/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1931,7 +1931,7 @@ def hello_world(self):
"2s",
"--json",
],
stderr=DEVNULL,
stderr=PIPE,
stdout=PIPE,
text=True,
)
Expand All @@ -1944,6 +1944,9 @@ def hello_world(self):

self.assertEqual(0, proc.returncode)

if not data:
self.fail(f"No data in json: {stdout}, stderr: {stderr}")

result = data[0]
self.assertEqual(float, type(result["last_request_timestamp"]))
self.assertEqual(float, type(result["start_time"]))
Expand Down

0 comments on commit 4e29bf6

Please sign in to comment.