MCPcopy
hub / github.com/dbcli/pgcli / before_scenario

Function before_scenario

tests/features/environment.py:166–185  ·  view source on GitHub ↗
(context, scenario)

Source from the content-addressed store, hash-verified

164
165
166def before_scenario(context, scenario):
167 if scenario.name == "list databases":
168 # not using the cli for that
169 return
170 if is_known_problem(scenario):
171 scenario.skip()
172 currentdb = None
173 if "pgbouncer" in scenario.feature.tags:
174 if context.pgbouncer_available:
175 os.environ["PGDATABASE"] = "pgbouncer"
176 os.environ["PGPORT"] = "6432"
177 currentdb = "pgbouncer"
178 else:
179 scenario.skip()
180 else:
181 # set env vars back to normal test database
182 os.environ["PGDATABASE"] = context.conf["dbname"]
183 os.environ["PGPORT"] = context.conf["port"]
184 wrappers.run_cli(context, currentdb=currentdb)
185 wrappers.wait_prompt(context)
186
187
188def after_scenario(context, scenario):

Callers

nothing calls this directly

Calls 2

is_known_problemFunction · 0.85
run_cliMethod · 0.80

Tested by

no test coverage detected