Commit Graph

368 Commits

Author SHA1 Message Date
Florian Bruhin
7c1ddb39d1 Remove unused import 2019-02-22 11:28:06 +01:00
Florian Bruhin
99c8b80a46 Use i- as prefix for the IPC path on macOS
With Qt 5.12, standarddir.runtime() gives us a path in /private/var/folders/...
instead of /var/folders/... like before. Due to that change, the path length is
105 chars, which is too long for a named socket (104 seems to be okay).

The complete name is just slightly too long, so using i- instead of ipc- fixes
things...

Fixes #4471
See #888
2019-02-22 10:22:09 +01:00
Florian Bruhin
2d996baea0 Fix remaining new flake8 issues 2019-02-16 19:51:58 +01:00
Florian Bruhin
e00a7ee5be Mark IPC test which is broken on macOS as xfail
See #4471
2018-12-12 11:34:18 +01:00
Florian Bruhin
40d376fbcf Move unit tests 2018-11-30 16:25:12 +01:00
Florian Bruhin
f6c36ccbee Rename openurl to load_url
We still call the :open command openurl, but in the tab API and in
TabbedBrowser it's now called load_url.
2018-11-30 08:31:03 +01:00
Florian Bruhin
b7de287e7b Move CommandError to api.cmdutils 2018-11-29 14:18:11 +01:00
Florian Bruhin
19628d0ae9 Move cmdutils.cmd_dict to objects.commands 2018-11-29 14:18:11 +01:00
Florian Bruhin
b5253ec473 Fix lint 2018-11-28 13:01:43 +01:00
Florian Bruhin
2237ca2bcf Remove now unneeded pylint suppressions 2018-11-28 12:54:19 +01:00
Florian Bruhin
d5a5e08eff Simplify test 2018-10-30 15:32:35 +01:00
Florian Bruhin
e23b6ef64e Merge remote-tracking branch 'origin/pr/4382' 2018-10-30 08:56:03 +01:00
Jay Kamat
9c73bf9e97
Add tests for selection persisting
- Remove unneeded override of qt home method
2018-10-27 16:15:24 -07:00
Florian Bruhin
a458615030 Further simplify caplog.messages 2018-10-25 11:16:26 +02:00
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