siddhugolu
4862b2faf9
modified pylint pragmas
2017-10-22 23:52:35 +05:30
Florian Bruhin
33df4eb865
Skip test_fake_haiku on Windows
2017-10-21 19:01:22 +02:00
Florian Bruhin
9dc9bcaf39
Make standarddir work on HaikuOS
...
For some reason, it returns an empty DataLocation.
2017-10-17 22:37:14 +02:00
Jay Kamat
4ff44eff7b
Clean up logic for finding git hash
...
Also add implementation for release scripts as well
2017-10-14 18:08:52 -04:00
Jay Kamat
ee3d7463f6
Change qute:version git commit to display hash
...
Replaces output of git-describe
Closes #3095
2017-10-13 23:30:07 -04:00
Florian Bruhin
35d5038ab1
Add missing test
2017-10-12 22:42:58 +02:00
Florian Bruhin
dfe2f9e38c
Also check PyQt version for qtutils.version_check()
...
With an older PyQt built against a newer Qt, we still don't have its features
available.
This also drops support for exact=True with compiled=True as the semantics for
that are unclear, and it's not used.
2017-10-12 19:13:20 +02:00
Florian Bruhin
6c3f90146f
Make qtutils.version_check strict by default
...
This also renames 'strict' to 'compiled' to be more descriptive.
It also fixes a crash when starting qutebrowser with an older compiled Qt
version which was introduced recently (calling setSpellCheckEnabled).
2017-10-08 19:08:37 +02:00
Florian Bruhin
4e46c34e5a
Use .assert_not_called() for mocks
2017-09-22 19:58:38 +02:00
Florian Bruhin
1d964ccdaf
Only run system datadir test on Linux
2017-09-20 12:20:46 +02:00
Florian Bruhin
46cfd5353d
Use a pytest marker to fake an OS
2017-09-20 11:30:18 +02:00
Florian Bruhin
ef1c83862b
Use utils.is_* for platform checks everywhere
2017-09-20 11:10:24 +02:00
Florian Bruhin
22be2bf7ab
Fix circular import in ImportFake in test_version
...
We can't use importlib.import_module() when we patched that away...
2017-09-20 08:17:04 +02:00
Florian Bruhin
3a5241b642
Start using attrs
...
Closes #1073
2017-09-19 22:21:45 +02:00
Florian Bruhin
8ae87bbde2
Remove typing module from version.py
...
It comes with python now
2017-09-18 23:06:49 +02:00
Florian Bruhin
3772dc5930
Drop legacy QtWebKit support
...
See #2742
2017-09-18 23:01:17 +02:00
Florian Bruhin
505321c336
Drop support for Python 3.4
...
See #2742
2017-09-18 23:01:17 +02:00
Florian Bruhin
852baaa8c3
Drop support for Qt < 5.7.1
...
See #2742
2017-09-18 23:01:17 +02:00
Florian Bruhin
fe05947b54
Add a new qt_args setting
...
See #2589
2017-09-17 22:53:27 +02:00
Florian Bruhin
70b8585e95
Move qtutils.unset_organization to standarddir
2017-09-17 20:44:08 +02:00
Florian Bruhin
f29bafcdb2
Fix expected dir on macOS
2017-09-17 10:35:05 +02:00
Florian Bruhin
7ed64efa08
Fix standarddir.cache() on Windows
2017-09-17 10:35:05 +02:00
Florian Bruhin
b31db0d0d5
Add another str() for paths
...
Using py.path for os.path is only supported since 3.6
2017-09-17 09:49:06 +02:00
Florian Bruhin
df9726a152
Fix standarddir without AppDataLocation
2017-09-17 09:49:06 +02:00
Florian Bruhin
9354297276
Add test for standarddir without QApplication
...
See #2791 .
2017-09-16 23:48:06 +02:00
Florian Bruhin
9706dcbda5
Fix lint
2017-09-16 23:48:02 +02:00
Florian Bruhin
a1fa40f067
Remove the ability to migrate old QtWebEngine data
...
Versions before v0.9.0 (which didn't even support hinting with QtWebEngine!)
used to write QtWebEngine data to:
~/.local/share/qutebrowser/qutebrowser/QtWebEngine/Default
~/.cache/qutebrowser/qutebrowser/QtWebEngine/Default
In v0.9.0 this was changed to:
~/.local/share/qutebrowser/webengine
~/.cache/qutebrowser/webengine
Now we don't try to migrate data from the old location anymore.
2017-09-16 23:48:02 +02:00
Florian Bruhin
a85e19a5e1
Add initial support for early standarddir init
...
See #2589 , #2791
2017-09-16 23:47:22 +02:00
Florian Bruhin
3179e8c7b9
Always autoescape jinja environments unless overridden
...
We were only rendering .html files before, so the old _guess_autoescape function
had the effect of always autoescaping .render() (from a file) but never
autoescaping .from_string(). However, most places using .from_string() actually
render (Qt-)HTML via jinja, so they should escape stuff!
Now, we always autoescape, except when the caller uses the
jinja.environment.no_autoescape() context manager, which places rendering
stylesheets now do.
This impacted:
- Confirm quit texts (no HTML here)
- config.py loading errors
(where this was found because of an error containing - a <keybinding>)
- Certificate error prompts
(should be fine from what I can tell, as the only user-controllable output is
the hostname, which cannot contain HTML)
2017-09-16 10:43:59 +02:00
Florian Bruhin
9f955f251a
Reshape comments
2017-09-15 14:11:45 +02:00
Florian Bruhin
12260e068a
Don't move cache directory on Windows
2017-09-14 13:35:42 +02:00
Florian Bruhin
0de7b2eb83
Skip standarddir migrations when a basedir is given
2017-09-14 00:37:54 +02:00
Florian Bruhin
3dc67df180
Fix minor standarddir migration issues
2017-09-14 00:37:54 +02:00
Florian Bruhin
9d95dec5ea
Handle standarddir.config() correctly on macOS
...
With auto=False we should get ~/.qutebrowser
2017-09-13 21:32:36 +02:00
Florian Bruhin
70a9a7e5c8
Fix macOS testsuite issues
2017-09-13 21:32:36 +02:00
Florian Bruhin
231193f7a6
Fix standarddir test coverage
2017-09-13 21:32:36 +02:00
Florian Bruhin
2f394d3c9f
Mock out all moving functions for standarddir.init()
2017-09-13 21:32:36 +02:00
Florian Bruhin
50aab7a802
Skip tests needing AppDataLocation on older Qt versions
2017-09-13 21:32:22 +02:00
Florian Bruhin
f7d17c4c55
Allow existing empty dir when migrating files
...
Remove old empty directory if it exists - otherwise, we move old/data to
new/data/data.
2017-09-13 21:32:22 +02:00
Florian Bruhin
e84c1fa82f
Call _init_config in test_fake_mac_auto_config
2017-09-13 21:32:22 +02:00
Florian Bruhin
2a9441dfbf
Make moving data in standarddir more generic
2017-09-13 21:32:22 +02:00
Florian Bruhin
ad2598b475
Add initial support for standarddir.config(auto=True)
...
This doesn't actually migrate things yet.
See #2791 , #383 .
2017-09-13 17:26:56 +02:00
Florian Bruhin
a2f16dbecd
Merge standarddir.system_data() into standarddir.data(system=True)
...
See #2791
2017-09-13 17:26:56 +02:00
Florian Bruhin
2d500d4efa
Also don't create ~/Downloads in standarddir.downloads()
...
This means we need to create it in downloads.py instead.
Fixes #2418
2017-09-13 17:26:56 +02:00
Florian Bruhin
91f5e72f02
Remove download dir from path info
...
This always returns the default Qt path (e.g. ~/Downloads) and also creates it
each time.
See #2418
2017-09-13 17:26:56 +02:00
Florian Bruhin
b185e57406
Remove change_qapp_name in test_standarddir
...
This is already done in conftest.py anyways
2017-09-13 17:26:56 +02:00
Florian Bruhin
56bbd73622
Introduce standarddir caching
...
This makes things a bit more complicated, but is needed to make standarddir (and
thus the config) work without a QApplication.
2017-09-13 17:26:56 +02:00
Florian Bruhin
f6a0500bd3
Merge branch 'master' into new-config
...
This pulls the travis changes to drop the old Qt 5.2 environment.
2017-09-11 18:39:41 +02:00
Florian Bruhin
b4f30f6df2
Move coverage to QtWebEngine environment with PyPI-PyQt
2017-09-11 18:30:23 +02:00
Ryan Roden-Corrent
111846a909
Merge remote-tracking branch 'upstream/master' into configmerge
2017-08-20 21:18:47 -04:00
Florian Bruhin
3a2d64ba46
version.distribution(): Handle Funtoo
2017-08-08 20:19:33 +02:00
Ryan Roden-Corrent
71b71dbc58
Merge remote-tracking branch 'upstream/master' into HEAD
2017-08-06 18:13:49 -04:00
Florian Bruhin
a942613d7f
Use ctypes instead of PyOpenGL for QtWebEngine Nvidia workaround
...
Fixes #2821
2017-07-27 09:22:12 +02:00
Florian Bruhin
fba25338be
Merge pull request #2295 from rcorre/really_complete
...
Completion refactor V3
2017-07-21 15:05:43 +02:00
Florian Bruhin
ad615941a2
Replace OS X with macOS
2017-07-08 11:12:43 +02:00
Ryan Roden-Corrent
515e82262d
Merge remote-tracking branch 'upstream/master' into really_complete
2017-07-07 20:42:21 -04:00
Florian Bruhin
215503ba59
Remove now useless suppression
2017-07-07 15:21:18 +02:00
Florian Bruhin
338d62204e
Make TestModuleVersions in test_version more maintainable
2017-07-06 12:36:11 +02:00
Florian Bruhin
66168a5b49
Add test ids to test_version_output
2017-07-06 12:25:11 +02:00
Florian Bruhin
911e59b0f4
Improve version output without SSL support
2017-07-06 12:23:08 +02:00
Florian Bruhin
94951d92a1
Simplify arg handling in test_version_output
2017-07-06 12:15:42 +02:00
Ryan Roden-Corrent
dc4472470e
Merge remote-tracking branch 'upstream/master' into really_complete
2017-07-05 08:45:57 -04:00
Florian Bruhin
0cdd3ff82f
Update some more references to old config options
2017-07-04 16:46:02 +02:00
Florian Bruhin
cff61fa0bc
Fix pylint
...
This also reverts commit 8df0b063be
.
2017-07-04 15:34:10 +02:00
Florian Bruhin
22b0f2fd24
Various simple test updates for new config
...
test_cache
test_cookies
test_webkitelem
test_cmdutils
test_runners
test_completionwidget
test_messageview
test_editor
test_miscwidgets
test_sessions
test_urlutils
test_utils
test_prompt
statusbar/test_*
test_cmdhistory
test_tabwidget
test_tab
test_downloads
test_networkmanager
2017-07-04 15:08:04 +02:00
Florian Bruhin
6733e92b50
Handle files correctly in utils.yaml_dump
2017-07-04 15:08:01 +02:00
Florian Bruhin
dfee857466
Make utils.yaml_dump return str
2017-07-04 14:42:56 +02:00
Florian Bruhin
1022b7ea32
Make jinja templating more strict
...
This ensures we actually know when an AttributeError happens.
It also changes most external code to use the correct environment, rather than
simply creating a jinja2.Template, which wouldn't use the more tightened
environment.
2017-07-02 22:17:33 +02:00
Florian Bruhin
aa6f229e6b
Add utils.yaml_{load,dump}
2017-07-02 22:17:33 +02:00
Florian Bruhin
5ec47da127
Get rid of configtypes.AutoSearch and IgnoreCase
2017-07-02 22:17:33 +02:00
Ryan Roden-Corrent
6ac940fa32
Fix pylint/coverage errors.
...
Ensure 100% coverage for sqlcategory and history, and fix some linter
errors
2017-06-27 12:33:51 -04:00
Florian Bruhin
750ef834dc
Make PyOpenGL a required dependency
...
Looks like the "black screen" issue isn't the only thing going wrong, some
people even report segfaults since the vendor check was added.
2017-06-20 13:05:53 +02:00
Ryan Roden-Corrent
6fc61d12fc
Assorted small fixes for sql code review.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
cf89ffa971
Fix pylint/flake8 errors
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
a8ed9f1c2f
Fix qute://version sql init bug.
...
Calling sql.init() in version.version() would replace the existing sql
connection and cause a crash when accessed by opening qute://version.
Now version relies on sql already being initted, and app.py inits sql early if
the --version arg is given.
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
Florian Bruhin
df0bd23d79
Make pylint shut up about test_version
2017-06-19 13:42:19 +02:00
Ryan Roden-Corrent
c6645d47ba
Remove newest_slice and StatusBar._option.
...
newest_slice is no longer needed after the completion refactor. Now that
history is based on the SQL backend, LIMIT is used instead.
StatusBar._option is not used, though I'm not sure why vulture only caught it
now.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
fc5fd6096a
Revert "Initialize SQL for two failing tests."
...
This reverts commit 386e227ce7534f1e427db7ba6d4e53dc153a49f3.
The problem was really state leakage, initializing sql for these tests isn't
necessary.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
490250f5be
Initialize SQL for two failing tests.
...
test_selectors and test_get_all_objects were running fine on my machine, but
for some reason is failing with "Driver not loaded" on Travis. Let's try
initializing SQL and see what happens.
2017-06-19 07:42:12 -04:00
Florian Bruhin
4ae8e247d0
Show 'legacy QtWebKit' in version output
2017-06-19 10:24:33 +02: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
8df0b063be
Get rid of utils.unused because it's unused
2017-06-06 17:04:21 +02:00
Florian Bruhin
eac284d880
Skip test_opengl_vendor without QtOpenGL
...
The test fails on Ubuntu Xenial because QtOpenGL is not installed.
This isn't a problem with real-life usage though, as we only call it with
QtWebEngine, and that ensures that QtOpenGL is available.
2017-05-31 10:29:46 +02:00
Florian Bruhin
912cea6e7d
Improve version.opengl_vendor()
...
On Windows with OpenGL ES we can't use versionFunctions, so we just return None
early.
Also, this fixes some lint and adds a smoke test.
2017-05-30 19:23:27 +02:00
Florian Bruhin
4cb82af11e
Add QUTE_FAKE_OS_RELEASE envvar
2017-05-30 07:37: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
aa8e6c8d17
Add parsed distribution to version info
...
Fixes #2369
2017-05-20 23:26:00 +02:00
Florian Bruhin
fe145b66c1
Add a version.distribution()
...
See #2369
2017-05-20 23:26:00 +02:00
Florian Bruhin
964b06bf7e
Fix shadowed import
2017-05-19 09:26:48 +02:00
Florian Bruhin
c4fb2bc609
Fix URL/renderer crash tests with Qt 5.9
...
The behavior in Qt changed there (in a good way), so we need to adjust the tests
accordingly.
Fixes #2514
2017-05-19 08:10:17 +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
822623f2ed
Finally update copyrights...
2017-05-09 21:37:03 +02:00
Florian Bruhin
bffdea6719
Read qWebKitVersion in qtutils.is_webkit_ng.
...
This means we need to try and import qWebKitVersion in qtutils, but better there
than at every place which calls it.
2017-04-28 21:36:02 +02:00
Florian Bruhin
4cd977cab6
Fix zero handling in qflags_key
2017-04-27 20:14:51 +02:00
Florian Bruhin
52f31ed15c
Rename urlutils.safe_display_url to safe_display_string
2017-04-24 07:49:12 +02:00
Florian Bruhin
195d0ea207
Show Punycode URL for IDN pages in addition to decoded one
...
This helps when Unicode homographs are used for phishing purposes.
Fixes #2547
2017-04-24 06:58:41 +02:00
Florian Bruhin
a1de313aa3
Add qapp to test_proxy_from_url_pac
2017-04-23 23:10:29 +02:00