Commit Graph

8895 Commits

Author SHA1 Message Date
Florian Bruhin
19077c8b47 Update docs 2016-07-23 15:47:31 +02:00
Florian Bruhin
91b754d6ea Merge branch 'issue_1033_bookmark_display' of https://github.com/winged/qutebrowser into winged-issue_1033_bookmark_display 2016-07-23 15:42:33 +02:00
David Vogt
1f320b8686 Various fixes after code review.
* Move documentation changes of bookmark / quickmarks to docstrings, as the
  asciidoc is autogenerated from those
* Fix some whitespaces in the BDD test cases
* Improved docstring in qute_bookmarks handler
2016-07-23 14:50:28 +02:00
Florian Bruhin
02a06732ff Also ignore ImportWarning for pkg_resources import 2016-07-23 14:15:39 +02:00
Florian Bruhin
78fd614237 Merge branch 'ganwell-issue_1670_tests_fail_due_to_SSL_error' 2016-07-23 14:03:08 +02:00
David Vogt
11bf5c8809 Minor cleanups. Whitespace / indentation CSS.
There were some CSS classes that were not used in the bookmarks page.
Also, fixes a small indentation / code alignment issue
2016-07-23 13:06:56 +02:00
Florian Bruhin
d1cc542835 Update authors 2016-07-23 13:05:55 +02:00
Florian Bruhin
40a3e24b05 Ignore warning when importing pkg_resources
On Debian Jessie we get a PendingDeprecationWarning which we now see
since the log is init'ed earlier.
2016-07-23 13:04:53 +02:00
Florian Bruhin
64f208486e Add log.ignore_py_warnings() 2016-07-23 13:04:45 +02:00
Florian Bruhin
36bb5cf285 Merge branch 'issue_1670_tests_fail_due_to_SSL_error' of https://github.com/ganwell/qutebrowser into ganwell-issue_1670_tests_fail_due_to_SSL_error 2016-07-23 12:46:16 +02:00
David Vogt
8bbfcc01be Sort bookmarks / quickmarks by title or name respectively. 2016-07-23 12:32:05 +02:00
David Vogt
12e7b4f244 Extend command documentation regarding bookmarks page
Add links to the qute:bookmarks page in the documentation for `:bookmark-add`
and `:quickmark-add` commands.
2016-07-23 12:27:31 +02:00
David Vogt
85be6565fc Implement feature request #1033: Bookmark display
There is a new page now, qute:bookmarks that will display all bookmarks and
quickmarks. It's still missing a search / filter feature, but you can use
the built-in search / navigation just as easily for now.
2016-07-23 12:09:49 +02:00
Jean-Louis Fuchs
f040fd5a6d Ignore missing SSLv3 messages from Qt 2016-07-23 10:01:56 +00:00
Jean-Louis Fuchs
ef01566621 Initialize qt logging to qutebrowser as early as possible 2016-07-23 09:54:13 +00:00
Florian Bruhin
76eab7617b Remove @pyqtSlot for functions and non-QObjects
Fixes #1669
2016-07-23 11:42:50 +02:00
Florian Bruhin
63e466f019 Remove @pyqtSlot for some non-QObject classes
Not sure if I got all, but at least I got the ones which fail
immediately on start.

See #1669.
2016-07-21 14:56:12 +02:00
Florian Bruhin
ac2553794c flake8: Ignore all dotfiles 2016-07-21 14:55:50 +02:00
Florian Bruhin
aabee4828e Merge branch 'rcorre-cut_test_clutter' 2016-07-20 16:19:49 +02:00
Florian Bruhin
a1c4e6e2cf Rename shadowed tmpdir variable 2016-07-20 16:13:46 +02:00
Florian Bruhin
5f2dc53d94 tox: Set distshare = {toxworkdir}
This is kind uf unorthodox and the "distshare" setting seems to be
deprecated, but we don't get a ~/.tox this way.

See #1637
2016-07-20 16:02:14 +02:00
Florian Bruhin
c4fb43df58 pylint: Set persistent=n
See #1637
2016-07-20 15:51:57 +02:00
Florian Bruhin
c7eec246d3 Merge branch 'cut_test_clutter' of https://github.com/rcorre/qutebrowser into rcorre-cut_test_clutter 2016-07-20 15:28:58 +02:00
Florian Bruhin
bf06f4a4d7 tests: Use dedicated logger for message mock
The message mock might handle a message during pytest-qt's processEvents
during test setup. If that happens, depending on the fixture order,
pytest-caplog might not be set up first, which is why the
self._caplog.at_level call can fail:

  File "c:\projects\qutebrowser\qutebrowser\misc\guiprocess.py", line 105, in on_finished
    immediately=True)
  File "C:\projects\qutebrowser\tests\helpers\messagemock.py", line 71, in _handle_error
    self._handle(Level.error, *args, **kwargs)
  File "C:\projects\qutebrowser\tests\helpers\messagemock.py", line 65, in _handle
    with self._caplog.at_level(log_level):  # needed so we don't fail
  File "C:\projects\qutebrowser\.tox\py34\lib\site-packages\pytest_catchlog.py", line 232, in at_level
    obj = logger and logging.getLogger(logger) or self.handler
  File "C:\projects\qutebrowser\.tox\py34\lib\site-packages\pytest_catchlog.py", line 186, in handler
    return self._item.catch_log_handler
  AttributeError: 'Function' object has no attribute 'catch_log_handler'

Full stack:

    c:\projects\qutebrowser-git\.tox\py34\lib\site-packages\pytestqt\plugin.py(100)pytest_runtest_setup()
  -> _process_events()
    c:\projects\qutebrowser-git\.tox\py34\lib\site-packages\pytestqt\plugin.py(140)_process_events()
  -> app.processEvents()
    c:\projects\qutebrowser-git\qutebrowser\misc\guiprocess.py(94)on_error()
  -> self._what, msg), immediately=True)
    c:\projects\qutebrowser-git\tests\helpers\messagemock.py(71)_handle_error()
  -> self._handle(Level.error, *args, **kwargs)
    c:\projects\qutebrowser-git\tests\helpers\messagemock.py(65)_handle()
  -> with self._caplog.at_level(log_level):  # needed so we don't fail
    c:\projects\qutebrowser-git\.tox\py34\lib\site-packages\pytest_catchlog.py(235)at_level()
  -> obj = logger and logging.getLogger(logger) or self.handler
  > c:\projects\qutebrowser-git\.tox\py34\lib\site-packages\pytest_catchlog.py(189)handler()->None

This should fix broken AppVeyor builds.

Fixes #1662.
2016-07-20 14:23:09 +02:00
Florian Bruhin
811361dbbe test requirements: Update beautifulsoup4 to 4.5.0
* Beautiful Soup is no longer compatible with Python 2.6. This
  actually happened a few releases ago, but it's now official.

* Beautiful Soup will now work with versions of html5lib greater than
  0.99999999.

* If a search against each individual value of a multi-valued
  attribute fails, the search will be run one final time against the
  complete attribute value considered as a single string. That is, if
  a tag has class="foo bar" and neither "foo" nor "bar" matches, but
  "foo bar" does, the tag is now considered a match.

  This happened in previous versions, but only when the value being
  searched for was a string. Now it also works when that value is
  a regular expression, a list of strings, etc.

* Fixed a bug that deranged the tree when a whitespace element was
  reparented into a tag that contained an identical whitespace
  element.

* Added support for CSS selector values that contain quoted spaces,
  such as tag[style="display: foo"].

* Corrected handling of XML processing instructions.

* Corrected an encoding error that happened when a BeautifulSoup
  object was copied.

* The contents of <textarea> tags will no longer be modified when the
  tree is prettified.

* When a BeautifulSoup object is pickled but its tree builder cannot
  be pickled, its .builder attribute is set to None instead of being
  destroyed. This avoids a performance problem once the object is
  unpickled.

* Specify the file and line number when warning about a
  BeautifulSoup object being instantiated without a parser being
  specified.

* The `limit` argument to `select()` now works correctly, though it's
  not implemented very efficiently.

* Fixed a Python 3 ByteWarning when a URL was passed in as though it
  were markup. Thanks to James Salter for a patch and
  test.

* We don't run the check for a filename passed in as markup if the
  'filename' contains a less-than character; the less-than character
  indicates it's most likely a very small document.
2016-07-20 14:07:01 +02:00
Florian Bruhin
dfbd31f35f Use /usr/bin/env shebang for bash userscripts
See #1665
2016-07-20 11:06:35 +02:00
Florian Bruhin
6130226a23 doc/stacktrace: Add qt5-webengine-debug 2016-07-20 09:40:09 +02:00
Florian Bruhin
d271c31edf pylint requirements: Update pylint to 1.6.4
* Recurse into all the ancestors when checking if an object is an exception

  Since we were going only into the first level, we weren't inferring
  when a class used a metaclass which defined a base Exception class
  for the aforementioned class.
2016-07-19 19:22:25 +02:00
Florian Bruhin
4161f4d6eb test requirements: Update CherryPy to 6.2.0
* Added tool to automatically convert request params based on type
  annotations (primarily in Python 3). For example:

    @cherrypy.tools.params()
    def resource(self, limit: int):
        assert isinstance(limit, int)
2016-07-19 09:36:51 +02:00
Florian Bruhin
70f14329e3 pylint requirements: Update pylint to 1.6.3
* Do not crash when inferring uninferable exception types for docparams
  extension
2016-07-19 09:24:51 +02:00
Ryan Roden-Corrent
48dbf505ce Limit config_tmpdir use in test_configtypes.
Only use the fixture in the test class that tries to access the config
dir (TestFileAndUserStyleSheet) rather than the whole test.
2016-07-18 21:49:37 -04:00
Ryan Roden-Corrent
7b3406a3e4 Use monkeypatch.setenv instead of os.putenv.
This ensures the environment is modified only for the test using the
fixture rather than for the whole test run.
2016-07-18 21:39:35 -04:00
Florian Bruhin
ea8e1f1131 Merge branch 'lahwaacz-#1657' 2016-07-18 14:31:20 +02:00
Florian Bruhin
8a290bf9b2 Add a test for #1657/#1658 2016-07-18 14:31:01 +02:00
Jakub Klinkovský
202883fc03 fix #1657
The _filterstr attribute was not cleaned up properly and persisted
between hintings. In this case, it was set to something representing the
Escape key.
2016-07-17 17:36:35 +02:00
Florian Bruhin
d867a789c2 Re-enable crash reports for QtWebEngine 2016-07-17 14:27:01 +02:00
Ryan Roden-Corrent
7d36847f77 Prevent test_tab from creating user data dir.
This is another case (like test_qt_javascript) that needs redirection
of XDG_DATA_HOME to prevent Qt from creating ~/.share/local/qute_test.
2016-07-17 07:07:05 -04:00
Florian Bruhin
f597b052c6 test requirements: Update CherryPy to 6.1.1
Fix issue where autoreload fails when the host interpreter for CherryPy
was launched using ``python -m``.
2016-07-17 12:00:54 +02:00
Ryan Roden-Corrent
5ae9d985b1 Prevent lingering object from test_config.
Using the config_tmdpir fixture across all tests in this module caused
a lingering LineParser to make test_debug fail.
I still don't know why, but scoping the config_tmpdir fixture to only
the test class that was creating ~/.config/qute_test fixes the issue,
and still prevents creation of a user tempdir.
2016-07-16 06:47:12 -04:00
Ryan Roden-Corrent
f589e44700 Don't write to user datadir in test_qt_javascript.
This was more complicated than the other data/config/cachedir test
fixes, as QtWebEngine was accessing the datadir directly (and bypassing
standdarddir.data).

This means the tmpdir_data stub is not enough, we need to set
XDG_DATA_HOME to redirect access.
2016-07-15 13:46:50 -04:00
Ryan Roden-Corrent
d9b546701e Prevent creation of user dirs on several tests.
Use the config_tempdir and data_tempdir fixtures for several tests that
were creation ~/.config/qute_test or ~/.local/share/qute_test.
2016-07-15 13:46:50 -04:00
Ryan Roden-Corrent
a6695ea1be Prevent test_adblock from creating real config dir.
Don't create ~/.config/qute_test by mocking out standdarddir.config for
all tests in this module.

This adds config_tmpdir to fixtures.py and moves temp_datadir from
test_adblock to fixtures.py as it will be needed more broadly.
2016-07-15 13:46:50 -04:00
Ryan Roden-Corrent
9c9b367887 Completely prevent tests from creating cachedir.
Attempting to fix the test on windows caused it to create the cachedir
again. The call to init(None) was unnecessary.
2016-07-15 13:46:50 -04:00
Ryan Roden-Corrent
cee5d6b97f Use fake_args in test_standarddir. 2016-07-15 13:46:50 -04:00
Ryan Roden-Corrent
34583d1565 Fix standarddir test on Windows.
Was broken by 48a2cad while trying to prevent creation of qute_test in
non-temp locations.
2016-07-15 13:46:50 -04:00
Ryan Roden-Corrent
1f71520bb2 Prevent tests from creating cachedir tag.
Running test_standarddir would pollute the user's home with
`~/.cache/qute_test`.

The `no_cachedir_tag` fixture was supposed to prevent this, but was not
working because [usefixtures does not work on fixtures]
(https://github.com/pytest-dev/pytest/issues/1014).

This fixes the fixture to actually prevent cachedir creation, but
applies it to tests individually (or by class) rather than with autouse
because the cachedir tests cannot pass if it is working.
2016-07-15 13:46:50 -04:00
Ryan Roden-Corrent
daaa5ff5c5 Don't create real config/data dirs from tests.
Running the tests would create ~/.config/qute_test and
~/.local/share/qute_test on the user's machine. The test_standardir
module needed a bit more mocking to prevent it from cluttering the
user's machine.

Two tests that created the data dir were fixed by passing basedir in
args, and one test that created the config dir was fixed by patching
os.makedirs to a noop.
2016-07-15 13:46:50 -04:00
Florian Bruhin
6f65973237 Adjust freeze_tests for cherrypy.wsgiserver merge 2016-07-15 17:05:41 +02:00
Florian Bruhin
701c2fe7d0 appveyor: Don't patch registry
In newer Appveyor images, only a key for Python 3.5 exists here.
2016-07-15 17:05:16 +02:00
Florian Bruhin
d710a98f46 Fix lint 2016-07-15 15:52:48 +02:00