Florian Bruhin
3b8964183e
Use caplog.messages
2018-10-24 10:57:17 +02:00
Florian Bruhin
1c7667014a
tests: Fix broken parametrization id functions
2018-10-24 10:57:17 +02:00
Florian Bruhin
91b8002dd5
Clean up workaround for sqlite opening errors
...
Now that we know the real cause, we can be a bit stricter with our workaround.
2018-09-12 16:06:57 +02:00
Florian Bruhin
c2a072f9fe
Fix handling of sqlite out of memory errors
...
The "error_code == -1" check never passed, as error_code (confusingly) is a
string of a number.
2018-09-12 01:36:50 +02:00
Florian Bruhin
37396d68f3
Define names for sqlite error codes
2018-09-01 22:25:22 +02:00
Florian Bruhin
f5c92ded41
Merge Sql{Environment,Bug}Error with Sqlite{Environment,Bug}Error
2018-09-01 22:25:22 +02:00
Florian Bruhin
50ae2bf2f9
Redesign SQL error handling
...
Instead of having an environmental attribute on exceptions, we now have two
different exception classes.
Fixes #3341
See #3073
2018-09-01 22:25:22 +02:00
Florian Bruhin
3f2a468750
Also detect missing bound values for sql.Query.run_batch
2018-09-01 18:25:58 +02:00
Florian Bruhin
fa1fe63a93
Add some more sql.Query tests
2018-09-01 18:25:58 +02:00
Florian Bruhin
0e284944e7
Use composition instead of inheritance for sql.Query
...
This means we're more loosely coupled to Qt's QSqlQuery, and also can move some
logic for handling batch queries from the table to there.
2018-09-01 18:25:58 +02:00
Florian Bruhin
6b719fb218
Make sure queries don't have any missing bindings
2018-09-01 18:25:58 +02:00
Florian Bruhin
1d6282fd6c
Add some tests for sql.Query
2018-09-01 18:25:58 +02:00
Florian Bruhin
9eeaa4f45d
Fix lineparser tests
2018-08-07 17:53:26 +02:00
Jimmy
19554ba4a1
Update PyPI api URL.
...
Flask 1.0 is out, pip made breaking changes, warehouse is a thing, new
requests soon. So
much fun in python world lately.
2018-05-02 23:08:51 +12:00
Florian Bruhin
d4899240de
Break long lines
2018-03-26 10:51:04 +02:00
Philip Lewis
cecb79cf05
Fix keyhints for special characters
...
`prefix` is a string and `seq` is a key sequence, so removing `len(prefix)`
items from `seq` will remove too many if `prefix` contains a special character
(ex "<Ctrl+x>"). Remove the number of characters from `str(seq)` instead.
2018-03-25 15:18:02 -04:00
Florian Bruhin
1d25b212d5
Add missing qapp fixtures to tests
...
See #3723
2018-03-15 09:06:40 +01:00
Ryan Roden-Corrent
73517f0a51
Fix test_backup_error.
...
- Need caplog at level error
- Rename test to be unique
2018-03-13 08:50:34 -04:00
Ryan Roden-Corrent
27966c94a6
Fix up editor backup patch.
...
- Use qutebrowser-editor-backup as the backup file prefix
- Consistently use message.error instead of cmdexc
- Improve test coverage for the backup function
- Fix lint errors in the unit test code
2018-03-13 07:34:18 -04:00
Ryan Roden-Corrent
38bb3673db
Preserve a backup if editor callback fails.
...
Currently the editor deletes its temp file whenever editing is finished.
With this patch, the file will not be deleted if the editor callback
encounters an exception.
One example is if the tab containing the edited element is closed. The
editor errors with "Edited element vanished", but with this patch it
will also print "Backup at ..." so the user does not lose their work.
Resolves #1596 .
Supersedes #3641 , using the cleaner approach started in #1677 .
2018-03-12 08:34:50 -04:00
Florian Bruhin
155a1901c0
Merge branch 'keys'
2018-03-04 22:50:41 +01:00
Florian Bruhin
fac8d72d8c
Capitalize Escape in TestFullscreenNotification
2018-03-04 20:21:57 +01:00
Florian Bruhin
53fb5af99c
Paste version information privately
2018-02-26 23:09:55 +01:00
Florian Bruhin
321d5c5d20
Merge branch 'master' into keys
2018-02-25 21:25:12 +01:00
George Edward Bulmer
29ff4259d6
Add test for _uptime()
2018-02-13 20:09:19 +00:00
George Edward Bulmer
ca8d935cf4
Update tests as per code review
2018-02-13 18:38:27 +00:00
Florian Bruhin
15fecc962d
Fix lint
2018-02-08 11:41:58 +01:00
Florian Bruhin
c520130389
Add tests for a failing watch/unwatch
2018-02-08 10:29:23 +01:00
Florian Bruhin
3306247ae5
Merge branch 'editor-watch'
2018-02-07 22:31:49 +01:00
Florian Bruhin
abd56a5abd
Wait until the mtime changed
2018-02-07 21:40:03 +01:00
Florian Bruhin
6f028e9ad0
Update copyright years
2018-02-05 12:19:50 +01:00
Ryan Roden-Corrent
a8733d7228
Increase timeout in test_editor.
...
The test with watch=True was failing on the Travis OSX environment
becausee it was timing out before the file_updated signal was fired.
2018-02-04 07:02:25 -05:00
Ryan Roden-Corrent
833df95485
Only detect save for open-editor and config-edit.
...
Scope down the new trigger-on-save behavior to only open-editor and
config-edit. Other uses of the editor such as edit-url and edit-command
will behave as before.
2018-02-03 19:57:47 -05:00
Ryan Roden-Corrent
530a1859a3
Trigger editor signal on exit if content changed.
...
With the previous code, the editor could miss the final signal on a
save-and-exit. This is avoided by always running the file changed
handler on a successful exit, but only firing the signal if the content
actually changed (to avoid double-signalling).
2018-01-27 15:03:18 -05:00
Ryan Roden-Corrent
a940de3717
Rename editing_finished to file_updated.
...
ExternalEditor now fires an event on save rather than on exit, so the
signal name should be updated to match the behavior.
2018-01-27 15:03:18 -05:00
Ryan Roden-Corrent
23eb6a6c53
Fix test_editor for edit-on-write behavior.
...
Now that the editor fires editing_finished on every write, the unit
tests had to be updated.
- Add qtbot to the editor fixture to resolve `QtWarningMsg:
QSocketNotifier: Can only be used with threads started with QThread`
- Use removePaths instead of disconnect to stop the watcher from
signalling. This avoids an error when the editor is forcibly cleaned
up by the tests without the signal ever being connected, but otherwise
has the same behavior as disconnecting the singal.
- wait for a signal on write instead of proc closed
- wait for _watcher.fileChanged in test_unreadable to ensure the write
event is fired before the test exits.
2018-01-27 15:03:18 -05:00
Fritz Reichwald
dc66ec5d8c
Fix expectation in Fullscreen info message to fit new description of
2018-01-06 20:01:57 +01:00
Florian Bruhin
e65c0dd8a7
pylint: Re-enable bad-continuation
...
And lots and lots of whitespace changes.
2017-12-15 19:16:55 +01:00
Florian Bruhin
7cebd95936
Simplify test_getitem
2017-12-15 14:41:38 +01:00
Florian Bruhin
e76732693c
Fix wrong import order
2017-12-15 14:35:07 +01:00
Florian Bruhin
0a612db733
Rename/move encoding test
2017-12-13 21:13:47 +01:00
Florian Bruhin
ddcdfa54aa
Fix test for invalid guiprocess encoding
2017-12-13 21:12:56 +01:00
Florian Bruhin
2b3250144b
Merge remote-tracking branch 'origin/pr/3388'
2017-12-13 20:06:00 +01:00
George Edward Bulmer
84e0ce757a
Fix erroneous docstring in a recently added test.
2017-12-13 14:50:25 +00:00
George Edward Bulmer
28961ab177
Add a test with invalid unicode in spawned stdout.
...
stderr features identical behaviour, so is currently untested.
2017-12-13 12:46:46 +00:00
George Edward Bulmer
9ca6baca4f
Modify instances of re.match to fullmatch or search.
...
This applies the changes to the tests directory only.
2017-12-12 15:07:37 +00:00
George Edward Bulmer
a2bcd68d56
Code review changes.
...
This fixes whitespace and alignment issues, and removes a stray test.
2017-12-11 13:35:39 +00:00
George Edward Bulmer
3b10584749
Update tests to work with the earlier consumption of stdin etc.
...
Note: this adds an element to vulture's whitelist that vulture
mistakenly identified as unused.
2017-12-10 23:46:35 +00:00
Florian Bruhin
dcb4448594
Merge remote-tracking branch 'origin/pr/3345'
2017-12-06 06:51:03 +01:00
Florian Bruhin
b5dd647678
Upgrade pydocstyle/flake8-docstrings
...
See #3320
2017-11-26 20:30:32 +01:00