Add assert message to test doth/stress_http_quota.py

This file is executed outside of pytest with pure python, which doesn't
do any AssertionError message rewriting like pytest. Ensure the assert
messages in this file provide a useful debug message.
This commit is contained in:
Tom Krizek 2023-11-24 15:32:09 +01:00
parent 64ef6968f3
commit 767f4670c6
No known key found for this signature in database
GPG key ID: 01623B9B652A20A7

View file

@ -161,12 +161,12 @@ class SubDIG:
# and examining their statuses in one logical operation.
class MultiDIG:
def __init__(self, numdigs, http_secure=None, extra_args=None):
assert int(numdigs) > 0
assert int(numdigs) > 0, f"numdigs={numdigs}"
digs = []
for _ in range(1, int(numdigs) + 1):
digs.append(SubDIG(http_secure=http_secure, extra_args=extra_args))
self.digs = digs
assert len(self.digs) == int(numdigs)
assert len(self.digs) == int(numdigs), f"len={len(self.digs)} numdigs={numdigs}"
def run(self):
for p in self.digs: