I resolved my issues getting pytest to run on my dev machine. When I did run it, I found that it was failing one test in test_do_commands in test_psiturk_shell with command['debug -p']
> assert not captured.err
E AssertionError: assert not 'generating debug url using `ad_url` config var\n'
E + where 'generating debug url using `ad_url` config var\n' = CaptureResult(out='[\x01\x02psiTurk\x01\x02 server:\x01\x02off\x01\x02 mode:\x01\x02sdbx\x01\x02 #HITs:0]$ mode sandbo...bugKTTJBW&hitId=debugDPJK04&workerId=debugIIT1PF&mode=debug\n', err='generating debug url using `ad_url` config var\n').err
The issue is that calls to Cmd2.pfeedback in psiturk_shell.py were added recently:
try:
base_url = self.config.get_ad_url()
self.pfeedback('generating debug url using `ad_url` config var')
except PsiturkException:
self.pfeedback('`ad_url_*` config vars not set; using Server '
'Parameters host and port vars.')
host = self.config.get('Server Parameters', 'host')
port = self.config.get('Server Parameters', 'port')
base_url = f"http://{host}:{port}/ad"
Because get_shell in test_psiturk_shell creates a shell where the quiet parameter is set to False.
So the options are:
ignore it,
change the test,
change Cmd2 to output non-essential feedback to stdout instead of stderr.
remove call to pfeedback
I think #3 is best option. I've implemented in a PR request that I'll post momentarily.
I resolved my issues getting pytest to run on my dev machine. When I did run it, I found that it was failing one test in test_do_commands in
test_psiturk_shell with command
['debug -p']
The issue is that calls to Cmd2.pfeedback in
psiturk_shell.py
were added recently:Because
get_shell
intest_psiturk_shell
creates a shell where thequiet
parameter is set to False.So the options are:
I think #3 is best option. I've implemented in a PR request that I'll post momentarily.