Commit Graph

350 Commits

Author SHA1 Message Date
Florian Bruhin
d0904a9f67 Adjust test settings 2017-07-04 15:08:02 +02:00
Ryan Roden-Corrent
1e1335aa5e Make various SQL code review changes.
- Fix outdated comments
- Use mock specs when possible
- More precise error message check in test_import_txt_invalid.
- Fix copyright message
- Tweak missing pyqt error message
- Dead code: remove group_by and where from sqlcategory.
  With the new separate completion table, these are no longer used.
- Move test_history out of webkit/. History is no longer purely webkit
  related, it could be webengine.
2017-07-03 09:45:08 -04:00
Florian Bruhin
3b53ec1cb6 Skip tests with permission changes if they didn't work
This e.g. wouldn't work inside of a Docker container otherwise.
2017-07-03 10:07:40 +02:00
Ryan Roden-Corrent
262b028ee9 Match error message in lineparser test. 2017-06-29 20:49:05 -04:00
Ryan Roden-Corrent
c007f592b3 Use more intuitive argument order in sql.delete. 2017-06-29 20:43:42 -04:00
Florian Bruhin
994e8c692f Merge different FakeTabbedBrowser objects 2017-06-20 15:19:53 +02:00
Ryan Roden-Corrent
891a6bcf14 Fix flake8 errors 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
4e87773d89 Use a dict instead of named params for insert.
This allows replace to be a named parameter and allows consolidating
some duplicate code between various insert methods.

This also fixes some tests that broke because batch insert was broken.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
22b7b21d5a Use named placeholders for sql queries. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
478a719f77 Use a prepared query for historyContains.
This is called often, hopefully a prepared query will speed it up.
This also modifies Query.run to return self for easier chaining, so you
can use `query.run.value()` instead of `query.run` ; query.value()`.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
39b561a182 Fix BaseLineParser::test_double_open.
Don't tie the test to a particular error message. Ths failed because a
typo was fixed (AppendLineParser -> LineParser).
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
20000088de Add debug-dump-history and fix sql history tests.
Trying to read from the sql database from another process was flaky.
This adds a debug-dump-history command which is used by the history BDD
tests to validate the history contents.

It outputs history in the old pre-SQL text format, so it might be
useful for those who want to manipulate their history as text.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
784d9bb043 Remove code rendered dead by sql implementation.
Vulture exposed the following dead code:

- AppendLineParse was only used for reading the history text file, which is now
  a sql database (and the import code for the old text file is simpler and does
  not need a complex line parser)

- async_read_done is no longer used as importing the history text file is
  synchronous (and should only happen once)

- config._init_key_config is unused as it was moved to keyconf.init
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
f110cf4d53 Fix long hang after importing history.
Turns out historyContains was getting called for the webkit backend multiple
times when the browser starts. This was calling `url in history`, which was
enumerating the entire history as `__contains__` was not defined.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
8ff45331df Clean up sql implementation.
Now that sql is only used for history (not quickmarks/bookmarks) a number of
functions are no longer needed. In addition, primary key support was removed as
we actually need to support multiple entries for the same url with different
access times. The completion model will have to handle this by selecting
something like (url, title, max(atime)).

This also fixes up a number of tests that were broken with the last few
sql-related commits.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
de5be0dc5a Store history in an on-disk sqlite database.
Instead of reading sqlite history from a file and storing it in an in-memory
database, just directly use an on-disk database. This resolves #755, where
history entries don't pop in to the completion menu immediately as they are
still being read asynchronously for a few seconds after the browser starts.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
56f3b3a027 Small review fixups for SQL implementation.
Respond to the low-hanging code review fruit:

- Clean up some comments
- Remove an acidentally added duplicate init_autosave
- Combine two test_history tests
- Move test_init cleanup into a fixture to ensure it gets called.
- Name the _ argument of bind(_) to _key
- Ensure index is valid for first_item/last_item
- Move SqlException to top of module
- Rename test_index to test_getitem
- Return QItemFlags.None instead of None
- Fix copyright dates (its 2017 now!)
- Use * to force some args to be keyword-only
- Make some returns explicit
- Add sql to LOGGER_NAMES
- Add a comment to explain the sql escape statement
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
3c676f9562 Fix pylint/flake8 errors for SQL work. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
a050cb94f6 Report sqlite version with --version. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
df995c02a3 Get rid of varargs in sql.run_query.
Things are clearer when just passing a list.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
839d49a8ac Fix up pylint/flake8 for completion revamp. 2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
a774647c26 Get test_models mostly working again.
- Adjust _check_completions to work for CompletionModel and SqlCompletionModel
- Move sql initialization into a reusable fixture
- Remove the bookmark/quickmark/history stubs, as they're now handled by sql
- Disable quickmark/bookmark model tests until their completion is ported to
  sql.
- Disable urlmodel tests for features that have to be implemented in SQL:
    - LIMIT (for history-max-items)
    - Configurable column order (for quickmarks)
    - Configurable formatting (for timestamp-format
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
f43f78c40f Implement SQL interface.
When qutebrowser starts, it creates an in-memory sqlite database. One
can instantiate a SqlTable to create a new table in the database. The
object provides an interface to query and modify the table.

This intended to serve as the base class for the quickmark, bookmark,
and history manager objects in objreg. Instead of reading their data
into an in-memory dict, they will read into an in-memory sql table.

Eventually the completion models for history, bookmarks, and quickmarks
can be replaced with SqlQuery models for faster creation and filtering.

See #1765.
2017-06-19 07:42:12 -04:00
Florian Bruhin
df6c4c6e73 Fix earlyinit.qt_version issues 2017-06-19 09:42:49 +02:00
Florian Bruhin
fdba676933 Move version.qt_version() to earlyinit
Importing version in earlyinit is a bad idea, as it already pulls in a lot of
stuff we don't want.
2017-06-19 08:57:29 +02:00
Florian Bruhin
27ea9a6954 Fix test_debug_trace 2017-06-05 20:17:39 +02:00
Florian Bruhin
7186dcb98f Send crash reports to private pastebin
Fixes #481
2017-05-29 09:20:10 +02:00
Florian Bruhin
ea2fbc427a tests: Use match= for pytest.raises 2017-05-23 09:36:00 +02:00
Florian Bruhin
af7923de4d tests: Use pytest.param 2017-05-23 08:08:46 +02:00
Florian Bruhin
00a7a0cee6 Reorganize pylint config
This removes various stuff we don't need anymoe, and also re-enables and fixes
the import order check.
2017-05-17 20:20:12 +02:00
Florian Bruhin
c6e31391de Fix most tests/lint 2017-05-10 09:19:24 +02:00
Florian Bruhin
1c50377c0a Initial work on new private browsing 2017-05-10 07:00:21 +02:00
Florian Bruhin
822623f2ed Finally update copyrights... 2017-05-09 21:37:03 +02:00
Florian Bruhin
004eb742f6 Stabilize test_guiprocess 2017-03-31 13:05:34 +02:00
Florian Bruhin
a55d1b1ee8 Save old socket for IPC
At least on Windows with Qt 5.8, we get readyRead notifications *after*
disconnect...
2017-03-31 13:03:17 +02:00
Ryan Roden-Corrent
a68f997d95 Make keyhint delay configurable.
ui.keyhint-delay controls the time from starting a keychain to showing the
keyhint dialog. Resolves #2462.
2017-03-22 21:50:26 -04:00
Florian Bruhin
5fb6d26465 Stabilize some tests 2017-03-06 06:28:26 +01:00
Florian Bruhin
199a2ffe27 Remove unneeded deleted attribute for FakeSocket 2017-03-05 15:15:12 +01:00
Florian Bruhin
5d0c9440f6 Fix monkeypatch 2017-03-01 12:12:40 +01:00
Florian Bruhin
ca4f249c30 Use three-argument form of monkeypatch.*attr 2017-03-01 11:33:41 +01:00
Florian Bruhin
29ffa3d134 Add a fullscreen notification overlay
From the spec:

  User agents should ensure, e.g. by means of an overlay, that the end user is
  aware something is displayed fullscreen. User agents should provide a means of
  exiting fullscreen that always works and advertise this to the user. This is
  to prevent a site from spoofing the end user by recreating the user agent or
  even operating system environment when fullscreen.

https://fullscreen.spec.whatwg.org/#security-and-privacy-considerations
2017-02-06 16:22:58 +01:00
Florian Bruhin
de50f30b9b Replace all GitHub links 2017-02-05 00:13:11 +01:00
Florian Bruhin
81d67f8a2c Remove support for an empty data/config/cachedir
See #2115
2016-11-14 23:13:21 +01:00
Florian Bruhin
a8d1187ba0 Fix keyhint tests 2016-11-03 08:40:41 +01:00
Florian Bruhin
b4872192c3 Merge branch 'more-tests' of https://github.com/HolySmoke86/qutebrowser into HolySmoke86-more-tests 2016-10-30 23:24:15 +01:00
Daniel Karbach
cfa9068eed flake...
*quitely shakes fist and then submits*
2016-10-28 11:23:05 +02:00
Daniel Karbach
6fff45daeb check exception messages in utilcmds tests 2016-10-28 10:50:58 +02:00
Daniel Karbach
e167f77d68 separate test for hunter exceptions 2016-10-28 10:44:55 +02:00
Daniel Karbach
6e510372fb more cleanup
jeez, this is getting embarrassing
2016-10-27 15:50:17 +02:00
Daniel Karbach
23a62e952d another lineparser/utilcmds test revision
* verify exception message in lineparser double open
* check for hunter with `pytest.importorskip`
* stricter exception checking in debug_trace test
2016-10-27 14:56:28 +02:00
Daniel Karbach
64cf8fcd39 lineparser/utilcmds test cleanup
* fix date in copyright
* remove redundant class docstrings
* don't rename utilcmds module in unit test
* use `mode_manager` fixture in place of FakeModeMan
* some whitespace
2016-10-27 14:23:01 +02:00
Florian Bruhin
ece3f3a2e1 Update to pytest-qt 2.1.0 2016-10-26 07:42:41 +02:00
Daniel Karbach
442549555b skip segfault test on windows
while technically possible (on both machine and OS level), termination due
to SIGSEGV cannot be prevented
maybe the test could be rewritten to spawn a subprocess and check its exit
status (of 11)
2016-10-25 17:24:14 +02:00
Daniel Karbach
9038b28ea4 different mocking of open() in lineparser test
apparently, python 3.4 (and less, probably) does not import
builtins into modules
2016-10-25 08:52:08 +02:00
Daniel Karbach
b5ffe979aa "typo" in utilcmds test 2016-10-25 08:48:04 +02:00
Daniel Karbach
e0d1fafe43 tests for misc.utilcmds 2016-10-24 17:13:38 +02:00
Daniel Karbach
bdb96becd6 unit tests for misc.lineparser 2016-10-24 17:10:47 +02:00
Florian Bruhin
ab7cbfdea0 Improve keyhint tests
This also brings them back to 100% coverage
2016-09-25 16:42:13 +02:00
Florian Bruhin
123aace3e8 Fix keyhint tests 2016-09-23 15:05:01 +02:00
Florian Bruhin
49f8fa6d76 Add some tests for earlyinit.fix_harfbuzz
See #1948
2016-09-16 08:43:12 +02:00
Florian Bruhin
7e30792bfe Fix lint 2016-09-15 14:51:22 +02:00
Florian Bruhin
fce9783570 Fix unit tests
Apart from changed parameters, messages now log even when messagemock is
used, so we needed to add a few caplog.at_level calls.
2016-09-15 14:51:22 +02:00
Florian Bruhin
a2254b671c Adjust tests/messagemock 2016-09-15 14:51:21 +02:00
Florian Bruhin
f16b96aa28 Initial implementation of new messages 2016-09-15 14:51:21 +02:00
Florian Bruhin
2df971a79c Move short_tmpdir fixture to conftest.py 2016-09-09 18:46:51 +02:00
Florian Bruhin
7f013b7808 Fix lint 2016-09-06 17:00:25 +02:00
Florian Bruhin
4f55b435f0 Move various session unit tests to BDD tests 2016-09-06 13:55:28 +02:00
Florian Bruhin
f6ba859896 Move tabhistory.TabHistoryItem to misc.sessions
This makes browser.webkit.tabhistory contain only QtWebKit-specific
code.
2016-09-06 09:50:55 +02:00
Florian Bruhin
7592345b6e Make unittests work without QtWebKit 2016-09-05 18:45:50 +02:00
Florian Bruhin
cf070d48f2 WebEngine: Disable createWindow for Qt < 5.7.1
Fixes #1911.

The bugfix is backported in my qt5-webengine-debug package, and
QUTE_QTBUG54419_PATCHED can be set to force qutebrowser to use
createWindow.
2016-09-05 15:08:00 +02:00
Florian Bruhin
1e601d3419 Add apikey to test_pastebin.py 2016-09-02 06:10:21 +02:00
Florian Bruhin
df3733af54 tests: Use pytest.fixture instead of yield_fixture
See #1877
2016-08-22 07:40:24 +02:00
Daniel Schadt
4d00b8fce9 tests: fix tests for misc.editor
Due to the change to NamedTemporaryFile, the _filename attribute was
removed. We now have to use _file.name.
2016-08-07 00:18:22 +02:00
Florian Bruhin
2b496a81ef tests: Use parametrize for parse_fatal_stacktrace 2016-08-05 09:01:09 +02:00
Florian Bruhin
029ea2e5a7 Add miscwidgets.WrapperLayout.wrap
This makes it easier for an user of WrapperLayout to wrap a widget.
2016-08-04 19:22:44 +02:00
Florian Bruhin
dbccb12b49 Move WrapperLayout to miscwidgets 2016-08-03 13:08:25 +02:00
Florian Bruhin
483072d842 Don't use QSignalSpy in IPC test
Fixes #1727.

For another testcase in the same file we still need to use it until
pytest-qt has a MultiSignalBlocker.args.
2016-08-02 12:45:30 +02:00
Ryan Roden-Corrent
86a08d17c2 Dedupe code in test_readline.
Many of the tests repeated the same block of logic, so consolidate it
into one function.
2016-07-30 22:00:12 -04:00
Ryan Roden-Corrent
a086095954 Implement unix_filename_rubout.
unix_filename_rubout deletes to the previous slash or whitespace,
unlike the previously implemented backwards-kill-word which treats and
non-alphanumeric character as a boundary.

To illustrate, given the text 'foo/bar.baz', unix_filename_rubout will
delete 'bar.baz' while backwards-kill-word will delete only 'baz'.

See #1710.
2016-07-30 19:34:38 -04:00
Ryan Roden-Corrent
6bcdacf1ce Implement readline's backward-kill-word.
This restores the previous behavior of `unix-word-rubout` as
`backward-kill-word`, which is closer to the naming used in readline.
It is bound to <Alt-Backspace> by default, though <Ctrl-Backspace> will
also work due to a builtin binding.

Resolves #1698.
2016-07-30 07:27:29 -04:00
Florian Bruhin
4bf94f3c24 Use order='strict' with qtbot.waitSignals
See #1702
2016-07-29 09:12:06 +02:00
Florian Bruhin
a7e9b4e5d7 Get rid of extend=True for qt_log_ignore
This is now the default, see #1702
2016-07-29 09:12:06 +02:00
Florian Bruhin
76eab7617b Remove @pyqtSlot for functions and non-QObjects
Fixes #1669
2016-07-23 11:42:50 +02:00
Florian Bruhin
6a07d231f4 pykint: Add some disable=unused-variable 2016-07-11 13:18:31 +02:00
Florian Bruhin
2136d00aa2 tests: Add a fake_args fixture 2016-07-10 17:04:25 +02:00
Florian Bruhin
5420d6d2ae Mark some session tests as xfail
There'll be a refactoring to add a session API to WebTab later anyways,
so no point in fixing this now.

As many tests as possible here should probably also be changed to
end2end ones as there's a lot of mocking going on.
2016-07-07 18:32:52 +02:00
Edgar Hipp
81c69421c5 Update test_readline.py 2016-06-24 12:00:53 +02:00
Florian Bruhin
4fccc89d7d Split browser into browser/browser.webkit 2016-06-13 11:18:21 +02:00
Florian Bruhin
f70a75978b Move browser.network.pastebin to misc 2016-06-13 09:48:53 +02:00
Florian Bruhin
aae205030c Add missing import 2016-06-09 10:29:16 +02:00
Florian Bruhin
d6926f0622 Fix expected data in AppendLineParser test
There were two different issues here:

- `\n` rather than `os.linesep` was used, which caused the "generated"
  file to have less data in it than expected
- A final `os.linesep` (or `\n`) was missing, but that was cancelled out
  by a off-by-one error when slicing, so wasn't an issue until we tried
  with \r\n endings.
2016-06-09 10:26:09 +02:00
Florian Bruhin
a870a2888f Improve LineParser clear tests 2016-06-08 11:33:37 +02:00
Florian Bruhin
44f626134b Use real files for lineparser tests 2016-06-08 11:33:37 +02:00
Florian Bruhin
1d51d63f0c LineParser tests: Clear self._data in _open 2016-06-08 10:36:46 +02:00
Florian Bruhin
b09fe8dca0 Document LineParserMixin attributes 2016-06-08 10:22:55 +02:00
Florian Bruhin
33bcced4a2 Add a test for AppendLineParser.clear 2016-06-08 10:11:59 +02:00
Florian Bruhin
64d4c9f83e Clean up end2end test file structure
This renames tests/integration to tests/end2end and moves some files to
tests/end2end/fixtures.
2016-05-29 18:20:00 +02:00
Florian Bruhin
b97736b117 Revert "Work around flake8-string-format bug"
This reverts commit 6c4beef783.
2016-05-29 14:17:32 +02:00
Florian Bruhin
1d87eee4d7 Fix starting when sys.stderr is None 2016-05-27 14:48:46 +02:00
Florian Bruhin
afcb018ee2 Fix some spelling mistakes
Found via http://jwilk.net/software/mwic
2016-05-27 12:07:00 +02:00
Florian Bruhin
6c4beef783 Work around flake8-string-format bug
When using flake8-string-format on Python 3.5 with str.format(*group) it
failed:

  Traceback (most recent call last):
    File "./.venv-flakes/bin/flake8", line 11, in <module>
      sys.exit(main())
    File ".../site-packages/flake8/main.py", line 33, in main
      report = flake8_style.check_files()
    File ".../site-packages/flake8/engine.py", line 181, in check_files
      return self._retry_serial(self._styleguide.check_files, paths=paths)
    File ".../site-packages/flake8/engine.py", line 172, in _retry_serial
      return func(*args, **kwargs)
    File ".../site-packages/pep8.py", line 1842, in check_files
      runner(path)
    File ".../site-packages/flake8/engine.py", line 126, in input_file
      return fchecker.check_all(expected=expected, line_offset=line_offset)
    File ".../site-packages/pep8.py", line 1574, in check_all
      self.check_ast()
    File ".../site-packages/pep8.py", line 1521, in check_ast
      for lineno, offset, text, check in checker.run():
    File ".../site-packages/flake8_string_format.py", line 288, in run
      assert isinstance(call.args, ast.Starred) is bool(has_starargs)
  AssertionError

This works around that issue.
See https://github.com/xZise/flake8-string-format/issues/11
2016-05-26 23:50:58 +02:00
Ryan Roden-Corrent
f58e2d91dc Add a keyhint blacklist.
Replace the setting ui.show-keyhints with ui.keyhint-blacklist, which
is a list of globs for keychains that shouldn't be hinted. This allows
users to prevent showing keyhints for keychains they already know.

keyhint-blacklist='*' is equivalent to show-keyhints=False.

Resolves #1515.
2016-05-24 20:46:39 -04:00
Ryan Roden-Corrent
b1aaf0f10f Only show keyhints after a short delay.
If a user knows the keychain and can type it quickly, we shouldn't
annoy them with a popup. Only show the keyhint if the user doesn't
complete their keychain in 500ms.

The isVisible() check in the tests is somewhat invalid now because it
is never immediately visible and I don't want to add a delay to unit
tests. I added a check that text() is not set for one test that was
only checking isVisible().

Addresses part of #1515.
2016-05-23 21:21:03 -04:00
Florian Bruhin
b934f8bc4e Fix lint 2016-05-20 13:07:36 +02:00
Ryan Roden-Corrent
5992b81850 Don't show keyhint if there are no hints.
Currently, the keyhint window is shown even if the keystring matches no
possible bindings. This causes an empty keyhint window to hang around
after entering hinting mode.

Instead, the window is now hidden if no bindings match the current
keystring.

Resolves #1507.
2016-05-19 07:02:23 -04:00
Ryan Roden-Corrent
822d148713 Update key hint tests for new format.
Change the unit tests to expect the new tabular format.
Also generally clean up the tests -- refactor from a class to
module-level functions as there was no need for a class here.
2016-05-17 07:04:53 -04:00
Ryan Roden-Corrent
3cd252ef82 Clean up html for keyhint text.
The \t was behaving the same as a space and the <b> was doing nothing.
2016-05-15 22:33:53 -04:00
Ryan Roden-Corrent
8eee5def5d Add unit tests for the keyhint widget.
- validate keyhint text for a partial keychain
- ensure special keybindings are not suggested
- ensure it is not visible when disabled
- ensure changes to the suffix color are picked up
2016-05-15 22:20:52 -04:00
Florian Bruhin
2a343cb3a1 Various code style improvements 2016-04-27 20:25:27 +02:00
Florian Bruhin
1954ebd63c Fix test_last_window_session_none 2016-04-10 18:22:58 +02:00
Florian Bruhin
642dc46ba9 flake8: Add hacking 2016-04-08 07:35:53 +02:00
Florian Bruhin
2f520f3b17 Rename test_editor.py to test_editor_unit.py 2016-04-05 19:49:01 +02:00
Florian Bruhin
19edea7343 Rename unit/misc/test_sessions.py to *_unit.py
Otherwise we get:

import file mismatch:
imported module 'test_sessions' has this __file__ attribute:
  /home/florian/proj/qutebrowser/git/tests/integration/features/test_sessions.py
which is not the same as the test file we want to collect:
  /home/florian/proj/qutebrowser/git/tests/unit/misc/test_sessions.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
2016-04-01 07:52:54 +02:00
Florian Bruhin
74706abbc1 Fix lint 2016-03-17 22:10:58 +01:00
Florian Bruhin
0830b400fe Merge branch 'editor_crash_behaviour' of https://github.com/EliteTK/qutebrowser into EliteTK-editor_crash_behaviour 2016-03-17 21:40:17 +01:00
Florian Bruhin
5311576c34 Check pep257 via flake8.
We'll still keep the pydocstyle environment though until flake8-pep257 adds
support for that:

https://github.com/Robpol86/flake8-pep257/issues/6
2016-02-10 19:18:47 +01:00
Florian Bruhin
7f791dfcb8 Remove now obsolete test. 2016-02-10 07:06:34 +01:00
Florian Bruhin
37bb26bdd5 Add a test in test_editor.py. 2016-02-02 06:53:12 +01:00
Oliver Caldwell
54ff2aa46c Merge remote-tracking branch 'TheCompiler/master' into relax-editor-templating 2016-01-31 22:43:58 +00:00
Oliver Caldwell
84c44f3395 Remove invalid test parameter 2016-01-31 22:23:35 +00:00
Florian Bruhin
4d9ea06768 tests: Make test IDs predictable.
This means we could use xdist in the future.
2016-01-25 22:15:31 +01:00
Florian Bruhin
526441bcae Fix new flake8 lint.
For some reason these issues weren't shown with pytest-pep8/flakes.
2016-01-22 17:33:58 +01:00
Florian Bruhin
ff2024a565 Add socket IDs to ipc debug messages. 2016-01-08 12:02:36 +01:00
Florian Bruhin
9ed79ad57d tests: Switch to qtbot.assertNotEmitted. 2016-01-08 10:00:42 +01:00
Florian Bruhin
1fb34331e5 tests: Default to raising=True for qtbot.
- 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.
2016-01-08 09:49:06 +01:00
Florian Bruhin
a5f2ac5f03 Adjust copyright years. 2016-01-04 07:12:39 +01:00
Florian Bruhin
168f65b1a4 tests: Use caplog.at_level, not atLevel. 2015-12-21 09:52:33 +01:00
Florian Bruhin
9f64dfb3b6 Skip all tests using py_proc when frozen. 2015-12-21 09:46:30 +01:00
Florian Bruhin
fc3a3ea8c6 Add missing not_frozen mark in test_guiprocess.
This should fix test failures when frozen.
2015-12-20 18:40:57 +01:00
Florian Bruhin
5c769d8000 Report stdout/stderr of failed subprocesses. 2015-12-18 21:23:33 +01:00
Florian Bruhin
c1951a8f15 tests: Get rid of QSignalSpy where we can. 2015-12-17 07:49:28 +01:00
Florian Bruhin
e6284ed5d4 tests: Improve some ugly test IDs. 2015-12-16 22:21:29 +01:00
Florian Bruhin
eff0e4c7cc pylint: Enable useless-suppression globally.
We deactivate it locally where needed, i.e. where we are sure it's some
platform-specific thing.
2015-12-01 23:01:09 +01:00
Florian Bruhin
b3515f5e82 pylint: Remove import-error disabling from tests. 2015-12-01 22:47:10 +01:00
Florian Bruhin
5817b47f75 Revert "Use fully qualified imports in tests."
Seems like this also breaks frozen tests...
This reverts commit c7fdcc92b8.
2015-12-01 22:45:59 +01:00
Florian Bruhin
109984c96e pylint: Check attr-defined-outside-init for tests. 2015-12-01 22:41:16 +01:00
Florian Bruhin
c7fdcc92b8 Use fully qualified imports in tests.
This is cleaner even if pylint can't handle it.
2015-12-01 22:03:59 +01:00
Florian Bruhin
150a83d8f4 pylint: Remove unneeded supressions. 2015-12-01 22:03:58 +01:00
Tomasz Kramkowski
c575435782 misc/editor: Fix tempfile deleted on error / editor crash
This patch attempts to fix an issue where an error occuring in
misc/guiprocess or the editor process crashing would delete the
temporary file thus making it impossible to recover changes not commited
to the form field from the editor.
2015-12-01 20:22:05 +00:00
Florian Bruhin
f7a13fa1f9 Rename LineParserWrapper to LineParserMixin.
This makes pylint shut up as it realizes it is, in fact, a mixin.
2015-11-30 07:11:35 +01:00
Florian Bruhin
83b94a8be5 Fix session tests.
FakeMainWindow needs to be a QObject now as we use sip.isdeleted since
8cf6ace0e7 and that raises a TypeError on
non-QObject's.
2015-11-28 20:41:42 +01:00
Florian Bruhin
be4cf19bb1 tests: Improve some parametrized test IDs. 2015-11-27 16:25:25 +01:00
Florian Bruhin
f3c378858b tests: Remove duplicate test_split testcases. 2015-11-27 16:22:48 +01:00
Florian Bruhin
196d1e95be tests: Skip test_normal_connection IPC test on OS X.
Seems like it hangs there sometimes.
2015-11-23 20:33:11 +01:00
Florian Bruhin
40c7990d3a tests: Skip ipc TestSendToRunningInstance on OS X.
This did hang often on OS X, and I don't have the time to properly debug this.

See #1045.
2015-11-12 22:17:37 +01:00
Florian Bruhin
416cfaf002 tests: Switch from pytest-capturelog to catchlog. 2015-11-11 19:57:03 +01:00
Florian Bruhin
0d67cff5cb Merge branch 'bdd'
Conflicts:
      tests/test_conftest.py
      tox.ini
2015-11-02 06:36:30 +01:00
Florian Bruhin
4451165a27 Change IPC warnings to debug.
This seems to show up on Ubuntu Trusty (with older Qt) as well...
2015-11-01 23:11:42 +01:00
Florian Bruhin
867f509bcc tests: Ignore QDisabledNetworkReply warning.
I guess they are displayed now during teardown with the changes in pytest-qt.
2015-11-01 18:04:09 +01:00
Florian Bruhin
c85aa40073 Skip connected_socket IPC tests on OS X.
Fixes #1045 - I don't have the time to look into this :-/
2015-10-26 09:04:41 +01:00