When a download was redirected or failed after a tab was closed, there was a
KeyError in the object registry.
Fixes#889. This is a regression introduced in
976f758da1 / #731.
With this change, no test should affect another one anymore. Changes in detail:
- Before each test, invalid lines are cleaned so the invalid output from the
previous test doesn't affect the next one.
- Before each test, qutebrowser is restarted if it was quit.
- After each test, the data is cleared properly in every case.
- If there was an invalid output, the test waits for 1s for more output, and
then terminates qutebrowser so it's restarted with a clean state.
We need to search for lines in the history because we could miss something
otherwise, but for subsequent wait_for calls, we really don't want to wait for
the same thing again.
This should make test_backforward.py more stable as it *actually* waits when
going back now. Before, it did produce failures such as this one on OS X:
____________________________ test_going_backforward ____________________________
[..]
@bdd.then(bdd.parsers.parse("The requests should be:\n{pages}"))
def list_of_loaded_pages(httpbin, pages):
requests = [httpbin.Request('GET', '/' + path.strip())
for path in pages.split('\n')]
> assert httpbin.get_requests() == requests
E assert [Request(verb...rward/1.txt')] == [Request(verb=...rward/2.txt')]
E At index 3 diff: Request(verb='GET', path='/data/backforward/1.txt') != Request(verb='GET', path='/data/backforward/2.txt')
E Full diff:
E [Request(verb='GET', path='/data/backforward/1.txt'),
E Request(verb='GET', path='/data/backforward/2.txt'),
E Request(verb='GET', path='/data/backforward/1.txt'),
E - Request(verb='GET', path='/data/backforward/1.txt')]
E ? ^
E + Request(verb='GET', path='/data/backforward/2.txt')]
E ? ^
tests/integration/features/conftest.py:85: AssertionError
- More work on supporting unusually encoded source.
- Files or directories with non-ASCII characters are now handled properly.
- Setting a trace function with sys.settrace was broken by a change in 4.0.1.
- Officially support PyPy 4.0, which required no changes, just updates to the
docs.