tests: Wait until page is dumped for header check.
If we don't do this, it's possible for the test process to delete the temporary directory before qutebrowser actually writes the file.
This commit is contained in:
parent
d4c24c935c
commit
607ca0f478
@ -1242,6 +1242,7 @@ class CommandDispatcher:
|
||||
data = mainframe.toHtml()
|
||||
with open(dest, 'w', encoding='utf-8') as f:
|
||||
f.write(data)
|
||||
message.info(self._win_id, "Dumped page to {}.".format(dest))
|
||||
|
||||
@cmdutils.register(instance='command-dispatcher', name='help',
|
||||
completion=[usertypes.Completion.helptopic],
|
||||
|
@ -268,6 +268,8 @@ class QuteProc(testprocess.Process):
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
path = os.path.join(tmpdir, 'page')
|
||||
self.send_cmd(':debug-dump-page --plain "{}"'.format(path))
|
||||
self.wait_for(category='message', loglevel=logging.INFO,
|
||||
message='Dumped page to {}.'.format(path))
|
||||
|
||||
with open(path, 'r', encoding='utf-8') as f:
|
||||
return f.read()
|
||||
|
Loading…
Reference in New Issue
Block a user