Commit Graph

1088 Commits

Author SHA1 Message Date
Florian Bruhin
02f367a308 Add basic profiling capability for quteproc tests.
When --qute-profile-subprocs is given, we write a profile file for each
qutebrowser invocation and also create prof/combined.pstats afterwards.
2016-02-11 08:02:44 +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
b6f1dd963d Handle Shift-Insert correctly in prompt mode.
Fixes #1299.
2016-02-10 06:40:54 +01:00
Florian Bruhin
5ae677376b Rerun TestPyQIODevice.test_qprocess if needed.
This adds a new pytest-rerunfailures dependency. For some reason, that test
sometimes fails with an empty string read, and I can't tell why.
2016-02-08 06:54:47 +01:00
Daniel Schadt
d02ec62e33 tests: fix tests for test_version
Broken since we changed pdfjs.PDFJSNotFound to have a parameter, which
was not given here.
2016-02-05 15:16:23 +01:00
Daniel Schadt
df8f87f8b6 tests: add tests for qutescheme 2016-02-05 15:14:23 +01:00
Florian Bruhin
83dc390808 tests: Move fixtures into a separate file. 2016-02-04 07:27:23 +01:00
Florian Bruhin
eb692ba7f6 Fix lint. 2016-02-04 07:13:27 +01:00
Florian Bruhin
774bcbf6b3 tests: Don't fail on teardown too if test failed.
When a end-to-end test failed which would've marked an error message as
expected later in the test, seeing the teardown message about an unexpected
error being logged is really confusing.
2016-02-04 06:43:14 +01:00
Florian Bruhin
43b6f18864 Whoops, don't use repr(json.dumps(...)) 2016-02-03 21:28:20 +01:00
Florian Bruhin
e5e1a0d95c Reject hints -> chars containing duplicate chars
Fixes #1286.
2016-02-03 21:05:35 +01:00
Florian Bruhin
0b491f6caf Use json.dumps for logged fake clipboard.
For some reason, when comparing the repr in the two processes, we get different
results on OS X and Windows:

- expected: "fünf"
- "f\xfcnf" coming back from the subprocess on OS X
- "fnf" on Windows

Instead we're comparing the json dump now, which should be more predictable.
2016-02-03 20:54:35 +01:00
Florian Bruhin
79f83a033d Add a fake clipboard for tests
There are a lot of problems and flakiness with using a real clipboard.

Instead we now have a :debug-set-fake-clipboard command to set a text, and use
logging when getting the contents.

Fixes #1285.
2016-02-03 20:27:11 +01:00
Florian Bruhin
921e8b50b7 Fix lint. 2016-02-03 08:16:59 +01:00
Florian Bruhin
3292c05340 tests: Display some more qutebrowser logs w/o -v.
50 lines of context is almost useless, e.g. when an exception occurs we don't
even see the traceback.
2016-02-03 07:55:10 +01:00
Florian Bruhin
6008adcb9f bdd: xfail broken yankpaste tests for now.
Using the clipboard seems to be a good recipe for a lot of weird pain.
Until we avoid it altogether (see #1285) we xfail those problematic tests.
2016-02-03 07:49:45 +01:00
Florian Bruhin
302745e0fe tests: Also poll clipboard after setting it. 2016-02-03 07:44:41 +01:00
Florian Bruhin
a90618128d tests: Empty clipboard after testing if it works.
Otherwise, if a test fails to actually put something into the clipboard, we end
up pasting "Does this work?" which could e.g. trigger a search.

When it's cleared, we at least get some "clipboard is empty" error instead.
2016-02-03 06:55:21 +01:00
Florian Bruhin
af28996f82 tests: Fail if duckduckgo gets loaded accidentally
In the long run, we should detect any accidental external accesses using
mitmproxy, as per #1282. In the meantime, we try to detect duckduckgo requests
being logged and fail the tests if that happens.

However, a duckduckgo URL is logged in fuzzy_url during startup/config init,
which is why we ignore it there.
2016-02-03 06:50:48 +01:00
Daniel Schadt
1e52f459c9 mhtml: new complex test case
The-Compiler wants a more beautiful test case since the old one was
pretty weird and took lots of explaining at pytest demos, so I made a
new one. This one is a bit nicer on the eye and - to say it with
The-Compiler's words - has no "weird pixelated globe with the
geocities-like background".

To compensate for the globe I've put in some trivia facts so that - if
you are one of the people that like to stare at test pages - you can
always learn something.
2016-02-02 22:23:40 +01:00
Florian Bruhin
67efd1c5e0 Fix lint. 2016-02-02 19:23:24 +01:00
Florian Bruhin
cf0034d42c Set __tracebackhide__ in quteproc.after_test 2016-02-02 19:16:45 +01:00
Florian Bruhin
65a4c71488 Merge branch 'master' of https://github.com/NoctuaNivalis/qutebrowser into NoctuaNivalis-master 2016-02-02 18:58:16 +01:00
Florian Bruhin
37bb26bdd5 Add a test in test_editor.py. 2016-02-02 06:53:12 +01:00
Florian Bruhin
ad290e8702 Merge branch 'relax-editor-templating' of https://github.com/Olical/qutebrowser into Olical-relax-editor-templating 2016-02-02 06:49:57 +01:00
Florian Bruhin
312daca2b0 fuzzy_url: Raise InvalidUrlError on empty URLs.
Before we raised QtValueError (via qtutils.ensure_valid), but maybe there are
more callers out there which call fuzzy_url with an empty input - and it makes
more sense to raise InvalidUrlError which gets displayed to the user than
raising QtValueError which is more like an assertion.
2016-02-02 06:38:48 +01:00
Florian Bruhin
14042403f6 Fix pasting of empty URLs. 2016-02-02 06:37:49 +01:00
Oliver Caldwell
a617bc3ef4 Add missing commas
I haven't written Python in quite a long time :|
2016-02-01 21:41:14 +00:00
Oliver Caldwell
5474f902dd Add more tests for new editor config 2016-02-01 21:36:24 +00:00
Oliver Caldwell
a14f8a201e Merge remote-tracking branch 'TheCompiler/master' into relax-editor-templating 2016-02-01 21:19:50 +00:00
Daniel Schadt
449a54c7d0 pdfjs: add file path to version information
Shows "bundled" if the bundled version is used.
2016-02-01 17:28:18 +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
a9a42e0a99 Removed invalid placeholder test 2016-01-31 22:36:58 +00:00
Oliver Caldwell
84c44f3395 Remove invalid test parameter 2016-01-31 22:23:35 +00:00
Florian Bruhin
d50e1be566 Add some more :paste-primary tests. 2016-01-31 22:08:46 +01:00
Florian Bruhin
af5d199e8f bdd: Simplify :paste-primary tests. 2016-01-31 20:56:37 +01:00
Florian Bruhin
44625b254c Merge branch 'shift_ins' of https://github.com/lahwaacz/qutebrowser into lahwaacz-shift_ins 2016-01-31 19:46:41 +01:00
Jakub Klinkovský
5ec224d1f9 Simplified test for paste-primary command
We don't need to move around for this test...
2016-01-30 14:03:54 +01:00
Jakub Klinkovský
b358566156 Added tests for paste-primary command 2016-01-30 13:57:26 +01:00
Florian Bruhin
85adf7593d Fix crash when downloading URL without path infos.
Fixes #1243.
2016-01-26 22:39:10 +01:00
Florian Bruhin
ea1627c1e6 Cancel permission prompt when tab is closed.
Fixes #1250.
2016-01-26 19:47:31 +01: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
aede904b3a bdd: Stabilize "Cloning to background tab" test.
I think this didn't actually wait until hello.txt was loaded because some logs
were parsed from the previous test:

http://www.qutebrowser.org/testresults/osx/1294.html
2016-01-24 19:17:39 +01:00
Florian Bruhin
be2c0e30b6 bdd: Stabilize "Closing a JS window twice" test.
After pressing the button to open a window, we have to wait until it's loaded
before continuing, otherwise the test is flaky:
http://www.qutebrowser.org/testresults/osx/1295.html

We can't simply wait with "wait until about:blank is loaded" as that page is
already loaded earlier.
2016-01-24 18:47:26 +01:00
Florian Bruhin
7dca8d7329 Fix lint. 2016-01-24 17:30:59 +01:00
Florian Bruhin
86f03c7d81 Merge branch 'master' of https://github.com/mikeri/qutebrowser into mikeri-master 2016-01-24 17:01:35 +01:00
Florian Bruhin
58fb2826ee flake8: Add flake8-putty plugin.
Apply a bit of putty to flake8.
https://pypi.python.org/pypi/flake8-putty/
2016-01-22 17:33:58 +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
Michael Ilsaas
4ad2d63c8a Shortened urlincdec tests to one and some styling 2016-01-21 18:37:46 +01:00