While pytest-sugar was nice to look at, it produced a lot of issues:
- Unusable on CI
- Unusable on OS X and Windows
- Garbage when terminal was resized during tests
- Missing space after test name since some while
This replaces it by pytest-instafail, which replaces the most important feature
of sugar, and on top of that, also works on CI.
- qtbot.waitSignal with raising=True is the default this way, so we remove the
raising=True.
- qtbot.waitSignal with raising=False stay untouched
- Some qtbot.waitSignal without raising had one added (because we don't want it
to raise)
- Some qtbot.waitSignal without raising actually should've raised, which they
do now.
- New qt_wait_signal_raising ini option can be used to override the default
value of the raising parameter of the qtbot.waitSignal and qtbot.waitSignals
functions when omitted:
Calls which explicitly pass the raising parameter are not affected.
- qtbot now has a new assertNotEmitted context manager which can be used to
ensure the given signal is not emitted.
For some reason I can't explain, since 2b0870084b
we got test failures on OS X, as the clipboard had the old value before waiting
for the change, the new (correct) value after waiting for it, but never
actually emitted 'changed'.
We could just re-check the contents after the timeout, but that'd mean we wait
1s for every test where this weird thing happens.
Instead, we poll the clipboard for every 100ms as long as the timeout (1s)
hasn't passed, and return as soon as it has the correct contents.
The output was almost always useless without -v because the debug log wasn't
shown at all, only error/info.
Now we display a maximum of 50 lines (regardless of what level) without -v.
Checking the requests from the webserver proved problematic, as often there's
some kind of caching going on. Instead, we only check the log, as this is used
for things like :navigate anyways, so if the log says the page got loaded, we
can trust it.
There's still "... should be requested" to check the actual requests.