Florian Bruhin
36f3e54e1d
Finish configutils tests
2018-02-20 12:30:34 +01:00
Florian Bruhin
685e3ffcfe
Fix and test UrlPattern/configutils.Values stringification
2018-02-20 12:30:34 +01:00
Florian Bruhin
145a21449b
configutils: Add first tests
2018-02-20 12:30:34 +01:00
Florian Bruhin
5978b7b35f
config: Improve tests for non-existent options
2018-02-19 22:09:54 +01:00
Florian Bruhin
463320b599
Make test_config.py work
2018-02-19 22:09:54 +01:00
Florian Bruhin
fecebd6ced
Start getting test_config.py to run
2018-02-19 22:09:49 +01:00
Florian Bruhin
7d80825853
Fix test_configfiles.py
2018-02-19 22:09:46 +01:00
Florian Bruhin
5d63dfb24c
Start fixing test_configfiles.py
2018-02-19 22:09:46 +01:00
Florian Bruhin
0f907b1a77
Fix getting YAML values in test_configcommands.py
2018-02-19 22:09:46 +01:00
Florian Bruhin
19f7b92abb
Fix test_configinit.py
2018-02-19 22:09:43 +01:00
George Edward Bulmer
561e5d17b9
Remove extraneous space
2018-02-12 14:22:25 +00:00
George Edward Bulmer
5b718446b6
Add test for sourcing config with invalid source
2018-02-12 14:19:18 +00:00
George Edward Bulmer
b59a7cdcc0
Report syntax errors as unhandled exceptions
...
Update tests accordingly
2018-02-12 14:07:05 +00:00
George Edward Bulmer
ce8b457bac
Only display exception type if no traceback
...
Update test to match
2018-02-12 13:43:22 +00:00
Florian Bruhin
5b22209eef
Run test_init_benchmark on CI again
...
See #2777
2018-02-10 19:50:20 +01:00
Marc Jauvin
504e29c004
fix configfiles tests
...
- fix test_renamed_key()
- fix test_deleted_key()
- combine both test_merge_persist tests using @pytest.mark.parametrize
- fix _handle_migrations(): mark data dirty for renamed and deleted
2018-02-09 21:25:11 -05:00
Marc Jauvin
57fe674dc4
shorten lines
2018-02-09 15:22:56 -05:00
Marc Jauvin
9b7db8ee8a
Need to mark config as dirty in _handle_migrations()
...
Add tests for tabs.persist_mode_on_change migration
2018-02-09 14:41:33 -05:00
Florian Bruhin
589605fe92
Fix lint
2018-02-09 10:39:16 +01:00
Florian Bruhin
1a81f7231b
Make sure multiple wrong keys are reported
2018-02-08 22:02:22 +01:00
Florian Bruhin
1a88b64c67
Add a test for keyconfig.get_command(..., default=True)
2018-02-08 21:53:41 +01:00
Florian Bruhin
298dcb4c90
Validate config separately from migrations
...
It makes for cleaner code, and it makes sure the target of renamed options
actually exists.
2018-02-08 21:49:41 +01:00
Florian Bruhin
3306247ae5
Merge branch 'editor-watch'
2018-02-07 22:31:49 +01:00
Florian Bruhin
6f028e9ad0
Update copyright years
2018-02-05 12:19:50 +01:00
Ryan Roden-Corrent
ceab4a4c1f
Fix pylint warnings
2018-02-03 08:12:45 -05:00
Ryan Roden-Corrent
2e5595b5c6
Update test_configcommands for new editor behavior.
...
Now that the editor signals on save, the configcommands editing
unittests need to emit the signal in the patch rather than relying on
on_proc_closed to emit the signal.
2018-01-27 15:03:18 -05:00
Marc Jauvin
2a274f0d8b
add test for bind without args and fix other tests to include win_id
2018-01-15 15:52:15 -05:00
Florian Bruhin
dcf89f7a28
Fix KeyConfig._prepare
2017-12-29 16:10:12 +01:00
Florian Bruhin
f203535e00
Merge remote-tracking branch 'origin/pr/3407'
2017-12-18 16:11:16 +01:00
Ryan Roden-Corrent
ef2de8201a
Fix colors.completion.fg default and description.
...
Update the description to mention the number of columns and change the
default to ["white", "white", "white"] to make it more obvious that
multiple colors can be specified. This also satisfies the config test
that expects the default value for ListOrValue types to be a list.
One other test had to be tweaked to use a config option that is still
just a QtColor rather than a ListOrValue.
While it is possible to provide just two colors, it is "undefined
behavior". It will use the first color as the third color, but that is
an artifact of the implementation and therefore not documented (though
also not an error, as it is harmless).
2017-12-18 08:42:22 -05:00
Ryan Roden-Corrent
31c2988693
Fix test_config.test_get for updated config.
...
colors.completion.fg is now a list instead of a QColor. As this test
specifically wanted to test a QColor, I just changed it to a different
config option.
2017-12-17 13:28:00 -05: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
bb44f1d4cc
Remove old pylint disables
2017-12-15 14:39:42 +01:00
Florian Bruhin
e76732693c
Fix wrong import order
2017-12-15 14:35:07 +01:00
Justin Partain
bcd9d13684
Update tests to use search.ignore_case
2017-12-12 11:31:28 -05:00
Ryan Farley
5ed8019115
update flake8 and flake8-deprecated
...
Updated requirements and adjusted the configuration in `.flake8`; other
files have been modified where the lack of per-file auto-ignore caused
problems, where putty's `# flake8: disable=` syntax could be replaced
with a simpler `noqa`, or where pylint directives already suppressed the
same error.
2017-11-26 00:16:14 -06:00
Florian Bruhin
0afd6b23c9
Add the option name to the backend error message
2017-11-24 09:25:45 +01:00
Florian Bruhin
5d8c9577a7
Improve hypothesis example generation for configtypes.Dict
2017-11-22 11:53:49 +01:00
Florian Bruhin
2b063f577e
Handle OSError in :config-write-py
2017-11-19 14:06:11 +01:00
Florian Bruhin
870c15a02c
Merge remote-tracking branch 'origin/pr/3264'
2017-11-13 20:40:23 +01:00
Florian Bruhin
df4a011d48
Put files into the config dir with :config-write-py and rel. paths
2017-11-13 10:58:51 +01:00
Jay Kamat
e00a072d15
Fix garbage collection of StyleSheetObserver objects
2017-11-10 23:25:46 -05:00
cryzed
6e719d1796
Fix issue #3251
2017-11-08 15:08:36 +01:00
Florian Bruhin
22f3fade24
Bump up default font size to 10pt
...
See #1585
2017-11-06 07:36:52 +01:00
Florian Bruhin
f52930c857
Make the window.hide_wayland_decoration option less special
2017-11-06 07:33:13 +01:00
Florian Bruhin
d8392d4852
Merge environment variable init tests
2017-11-06 07:05:32 +01:00
Florian Bruhin
341e8ca864
Add a qt.highdpi setting
...
See #1585
2017-11-06 07:02:07 +01:00
Florian Bruhin
691a152ec8
Remove old config file
2017-11-06 06:48:23 +01:00
Florian Bruhin
5689a3c0dc
Fix unbinding default keys twice
...
When doing :unbind with a default keybinding the first time, it gets inserted
into bindings.commands with None as value.
When then doing :unbind a second time, instead of just leaving that None value
as-is, we removed it again (because it got treated as a custom binding).
Fixes #3162
2017-11-04 15:17:19 +01:00
Florian Bruhin
9a69ccc9e3
Merge remote-tracking branch 'origin/pr/3100'
2017-11-02 11:32:45 +01:00
Florian Bruhin
0b86b302a2
pylint: Turn off some more too-many-* stuff globally
...
Humans are just better at judging what's okay here than a machine.
2017-10-31 07:35:00 +01:00
lxhillwind
048b792c6f
add <EOL> in :config-write-py
generated file
2017-10-26 00:52:22 +08:00
Florian Bruhin
984dd1ba8c
Fix remaining pylint/flake8 issues
2017-10-24 09:37:10 +02:00
siddhugolu
bc9d305354
modified as requested
2017-10-23 01:46:02 +05:30
siddhugolu
4862b2faf9
modified pylint pragmas
2017-10-22 23:52:35 +05:30
Luca Benci
8b91a74aef
Fix broken test after default config change
2017-10-22 20:02:06 +02:00
Florian Bruhin
589e9b7153
Fix string escaping in config.source test
2017-10-20 10:05:42 +02:00
Luca Benci
937d0d0688
Add some more tests
2017-10-18 20:30:16 +02:00
Luca Benci
0d7a557396
Fix configtypes tests so that placeholder is True
2017-10-18 20:30:03 +02:00
Florian Bruhin
378498bbd7
Add a test for multiple config.source() errors
2017-10-18 14:06:54 +02:00
Florian Bruhin
5a9042ab3e
Add a config.source() method
2017-10-18 13:53:26 +02:00
Luca Benci
06b990c0d1
Add ShellCommand tests for {file}
2017-10-17 23:03:42 +02:00
Florian Bruhin
d8384ced0a
Show better error message when trying to toggle with :set
2017-10-17 06:26:42 +02:00
Florian Bruhin
2a65cadb67
Fix setting monospace fonts with None values
...
Fixes #3130
2017-10-16 06:18:09 +02:00
Florian Bruhin
27c46f20c0
Make sure the config default values are mutable
...
While the old values meant the same thing, they weren't mutable, so the config
couldn't modify them with a simple .append().
Fixes #3104
2017-10-14 16:40:44 +02:00
Florian Bruhin
4f870f902c
Fix loading of monospace fonts in configtypes.QtFont
...
See #3096
2017-10-12 18:26:54 +02:00
Florian Bruhin
c87d369725
Improve fonts.monospace tests
2017-10-11 22:14:58 +02:00
Florian Bruhin
a21a60c5ca
Fix updating fonts when fonts.monospace is changed
...
Fixes #2973
2017-10-11 22:14:55 +02:00
Florian Bruhin
cbe9ff7435
Fix reading of fonts.monospace on init
...
See #2973
2017-10-11 22:06:47 +02:00
Florian Bruhin
9c080538ba
Add a setting to force the platform and improve Wayland handling
...
Closes #3078
See #2932
2017-10-11 09:23:21 +02:00
Florian Bruhin
bdc82bc633
Fix lint
...
See https://github.com/PyCQA/pylint/issues/1698
2017-10-11 08:41:23 +02:00
Florian Bruhin
2a3369e2fe
Show nicer errors when trying to set deleted/renamed options
2017-10-11 08:00:38 +02:00
Florian Bruhin
0cd5d4300b
Rename qt_args and force_software_rendering to add qt. prefix
...
Closes #3077
2017-10-11 07:45:38 +02:00
Florian Bruhin
abbd69f604
Implement deleting/renaming values in configdata.yml
...
This is needed for #3077 , but also is used for the deletion in #2847 now.
See #2772 .
2017-10-11 07:13:51 +02:00
Florian Bruhin
0e64511d63
Split up _init_envvars from configinit.early_init
2017-10-09 06:52:14 +02:00
Florian Bruhin
f63b95c298
Fix the window.hide_wayland_decoration setting
...
Fixes #2267
2017-10-09 06:50:29 +02:00
Florian Bruhin
36ef68c698
Add :bind --default
...
Closes #3059
2017-10-08 21:48:48 +02:00
Florian Bruhin
51ea56375e
Improve error handling for config commands
...
- Use self._handle_config_error() for key commands too
- Catch getting an invalid key properly
- Remove (wrong) "set: " prefix
2017-10-08 14:40:10 +02:00
Florian Bruhin
c63d16e2ea
tests: Get rid of duplicate key config stubs
2017-10-05 11:22:54 +02:00
Florian Bruhin
012f79b244
Make sure key_config_stub is available when needed
2017-10-05 11:05:16 +02:00
Florian Bruhin
712e4a975a
Add a test to make sure :write-config-py files actually work
2017-10-05 10:48:14 +02:00
Florian Bruhin
3cb93b22ae
Add tests for :config-write-py
2017-10-05 10:34:25 +02:00
Florian Bruhin
ade0e1bd0b
Finish ConfigPyWriter and tests
2017-10-05 10:21:31 +02:00
Florian Bruhin
da4402e98c
Don't rely on order in test_clear
2017-10-04 09:02:34 +02:00
Florian Bruhin
38270de120
Avoid configdata init in test_configinit
...
See #2777
2017-10-04 09:01:31 +02:00
Florian Bruhin
6037d44d0e
Remove unused imports
2017-10-04 08:56:32 +02:00
Florian Bruhin
969b8f3200
Fix test_configcommands on Python 3.5
...
looks like assert_called_once() was introduced in 3.6
2017-10-04 08:55:33 +02:00
Florian Bruhin
37fa7a0d3e
Fix casing in test name
2017-10-04 08:47:33 +02:00
Florian Bruhin
208b4d1cbc
Make configfiles.YamlConfig iteration deterministic
2017-10-04 08:47:10 +02:00
Florian Bruhin
7cbb2b079f
Use existing tabbed_browser_stubs fixture in tests
2017-10-04 06:35:42 +02:00
Florian Bruhin
22088d9f7b
Remove --force for :bind and config.bind(...)
...
Turns out --force is just in the way for most people, and at least for default
bindings it's easy to reset them.
Also, it makes :config-source fail when config.py contains keybindings.
Closes #3049
2017-10-03 20:43:38 +02:00
Florian Bruhin
727580d1f4
Add a :config-edit command
...
See #2794
2017-10-03 20:43:38 +02:00
Florian Bruhin
8edaad51c3
Add a :config-source command
...
See #2794
2017-10-03 16:28:11 +02:00
Florian Bruhin
0695cfccfc
Improve some configfile tests
2017-10-03 14:33:33 +02:00
Florian Bruhin
999d70ae40
Add missing config.py tests
2017-10-03 14:13:10 +02:00
Florian Bruhin
9383452ab9
Use a real YAML config for config tests
2017-10-03 13:06:50 +02:00
Florian Bruhin
ed8c3f4aa2
Add :config-clear and :config-unset
...
See #2794
2017-10-03 12:45:39 +02:00
Florian Bruhin
4ed60efa80
Add missing qapp fixture
2017-10-03 07:38:10 +02:00
Florian Bruhin
f533e3b751
Move config toggling to :config-cycle
...
This removes :set option! and allows :config-cycle option instead.
2017-10-03 07:38:10 +02:00
Florian Bruhin
81993a70a2
Split off :config-cycle from :set
...
Before, we allowed :set to take multiple values, which often lead to confusing
error messages when a user forgot to quote the value.
Now, we instead have a dedicated :config-cycle command for that.
See #1840 , #2794
2017-10-03 07:37:55 +02:00
Florian Bruhin
fbf9817dcb
Rename test classes
2017-10-02 07:15:00 +02:00
Florian Bruhin
a8fc561707
Split config commands off to their own file.
2017-10-02 07:08:30 +02:00
Florian Bruhin
a273baf8a0
Make sure :bind/unbind works properly when bindings.commands is None
...
To make this work, we should never return None when trying to get bindings to
modify.
Fixes #3026
2017-10-01 21:43:00 +02:00
Florian Bruhin
45db0eaccb
Really force QtWebEngine for test_force_software_rendering init
2017-09-28 11:44:21 +02:00
Florian Bruhin
6c25e96621
Remove unused imports
2017-09-28 11:38:52 +02:00
Florian Bruhin
3be0a78819
Fix configinit tests
2017-09-28 11:05:53 +02:00
Florian Bruhin
35beb84e85
Fix tests and lint
2017-09-28 09:38:57 +02:00
Florian Bruhin
9607f3de59
Improve type documentation of settings
...
Use .get_name() for the docs
2017-09-27 08:25:52 +02:00
Florian Bruhin
c694bff902
Allow direct values for url.start_pages and content.user_stylesheets
2017-09-27 08:21:03 +02:00
Florian Bruhin
38449e3e2b
Make sure the autoconfig.yml is saved periodically
...
Fixes #2982
2017-09-26 06:41:55 +02:00
Florian Bruhin
38038df703
Compare objects with :set with multiple values
2017-09-25 21:24:12 +02:00
Florian Bruhin
1086e31f28
Split up configinit tests
2017-09-25 21:24:12 +02:00
Florian Bruhin
6aed6bca93
Make loading autoconfig.yml opt-in when a config.py exists
...
This lets the user control the precedence those files should have, and also
simplifies the code quite a bit.
Fixes #2975
2017-09-25 21:24:12 +02:00
Florian Bruhin
40f0f75ad5
Improve error message for duplicate keys in config.py
2017-09-24 19:43:30 +02:00
Florian Bruhin
b8389e4496
Revert "Fix NUL byte error handling on Python 3.4"
...
This reverts commit a7d5a98cc4
.
Not needed anymore now that we dropped support.
2017-09-22 22:30:02 +02:00
Florian Bruhin
e8ceeceac8
Fix mock check with Python 3.5
...
Looks like .assert_not_called() doesn't work on function mocks with 3.5.
2017-09-22 22:28:40 +02:00
Florian Bruhin
4e46c34e5a
Use .assert_not_called() for mocks
2017-09-22 19:58:38 +02:00
Florian Bruhin
5be44756e3
Remove unused imports
2017-09-22 17:29:01 +02:00
Florian Bruhin
d5a1fff637
Move init stuff from config.py to configinit.py
...
Closes #2997
2017-09-22 14:11:54 +02:00
Florian Bruhin
501764d1cb
Fix documented default values for falsey non-strings
...
Fixes #3015 .
2017-09-22 13:18:27 +02:00
Florian Bruhin
7f8ae531aa
Add config.configdir and config.datadir to config API.
...
Fixes #1419
2017-09-22 09:59:46 +02:00
Florian Bruhin
9b22480b07
Raise config.py errors happening in tests
2017-09-22 09:09:45 +02:00
Florian Bruhin
1dbd156c2f
Simplify some config.py tests
2017-09-22 08:53:08 +02:00
Jay Kamat
43ce10efc3
Simplify and reorganize configfile tests
...
Also make save/load of sys.path a little more robust
2017-09-22 02:05:55 -04:00
Jay Kamat
4e22b4666d
Convert save-restore of sys to a context-manager
...
Also improve and simplify tests for save/load of sys.module and sys.path
2017-09-22 02:05:55 -04:00
Jay Kamat
7ddde334da
Add tests for module/path isolation
2017-09-22 02:05:55 -04:00
Florian Bruhin
64b783d9c0
Do not validate commands in the config and with :bind
...
There are just way too many gotchas related to valid modes, aliases, and
circular dependencies when validating aliases/bindings in the config.
Let's just remove this and let invalid commands fail late, when they're actually
used.
2017-09-21 22:30:48 +02:00
Florian Bruhin
32b2b3dfd9
Add test for invalid value type in YAML file
2017-09-21 21:15:37 +02:00
Florian Bruhin
b1ddb9a6df
Remove confusing test
...
That's not the behavior we actually have in the config anymore when using
conf._yaml.load().
2017-09-21 20:27:45 +02:00
Florian Bruhin
691cd2d09b
More test_configfiles cleanups
2017-09-21 20:19:02 +02:00
Florian Bruhin
3e0d49a4b3
Add TestYaml class to test_configfiles
2017-09-21 19:57:54 +02:00
Florian Bruhin
f821fb793a
Initialize configdata in test_configfiles
2017-09-21 19:37:22 +02:00
Florian Bruhin
7cad8f41f2
Remove unknown YAML data from config
...
I considered introducing another list of deleted options (or a "deleted: True"
in configdata.yml), similar to what we had with the old config.
However, let's take the easier route and just delete everything we don't know
from configdata.yml. If someone edits it by hand, it's their fault :P
See #2772 , #2847
2017-09-21 16:29:40 +02:00
Florian Bruhin
9a6de48efa
Break long line
2017-09-21 09:12:25 +02:00
Florian Bruhin
fb33985f07
Merge remote-tracking branch 'origin/pr/2992'
2017-09-21 09:12:03 +02:00
Felix Van der Jeugt
6892705e18
cover setting-saving-loading-getting yaml config
2017-09-20 15:52:42 +02:00
Florian Bruhin
ef1c83862b
Use utils.is_* for platform checks everywhere
2017-09-20 11:10:24 +02:00
Felix Van der Jeugt
285b534384
make changed dirty and save on duplicate write
2017-09-20 10:04:34 +02:00
Florian Bruhin
55cbb39127
Merge remote-tracking branch 'origin/pr/2999'
2017-09-20 08:48:22 +02:00
Ryan Farley
dd4294de03
fix #2979 : use dictionary for mutable tracking
...
Using a dictionary instead of a list keeps only one working copy,
allowing consistency in between calls of update_mutables()
2017-09-19 16:26:02 -05:00
Florian Bruhin
3a5241b642
Start using attrs
...
Closes #1073
2017-09-19 22:21:45 +02:00
Ryan Farley
cc540bb166
Merge branch 'master' into mutable-dict
2017-09-19 14:07:46 -05:00
Ryan Farley
83473b9c69
fix test for new tuples
2017-09-19 14:00:44 -05:00
Felix Van der Jeugt
8db630d358
don't copy values but set dirty
2017-09-19 17:26:03 +02:00
Felix Van der Jeugt
7b192d426e
add unit test and fix issues with it
2017-09-19 15:30:28 +02:00
Florian Bruhin
248afde21e
configapi: Also allow mode as posarg
2017-09-19 13:18:44 +02:00
Florian Bruhin
e8ae672c93
Check for read errors in test_configfiles
2017-09-19 13:18:16 +02:00
Florian Bruhin
7d1549aaeb
Make mode optionally in ConfigAPI.bind and .unbind
2017-09-19 13:14:41 +02:00
Florian Bruhin
e9b8288e4b
Add a test for Config._set_value without backend
2017-09-19 07:08:56 +02:00
Florian Bruhin
13a8867e13
Add tests for config.get_backend()
2017-09-19 07:05:36 +02:00