Read about our upcoming Code of Conduct on this issue

Commit 738ad8ee authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Testing production servers: nicer error if group owner not specified

This is better than an obscure unexpected `None` down the road.
Maybe there's even a way to have pytest issue the proper `parser.error`
call, but this will be good enough for the time being.

branch : stable
parent 3162debaf0f1
...@@ -232,9 +232,16 @@ def heptapod(pytestconfig): ...@@ -232,9 +232,16 @@ def heptapod(pytestconfig):
try: try:
if active_threads == 1: # we're the first if active_threads == 1: # we're the first
if pytestconfig.getoption('heptapod_prod_server'): if pytestconfig.getoption('heptapod_prod_server'):
owner_creds = pytestconfig.getoption(
if owner_creds is None:
raise RuntimeError(
"Production server mode: please specify a Group owner "
"with the --heptapod-prod-group-owner-credentials "
"option (see --help for syntax)")
heptapod = ProductionHeptapod( heptapod = ProductionHeptapod(
group_owner_credentials=pytestconfig.getoption( group_owner_credentials=owner_creds,
default_group_id=pytestconfig.getoption( default_group_id=pytestconfig.getoption(
'heptapod_prod_group_id'), 'heptapod_prod_group_id'),
**common **common
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment