Commit Graph

32 Commits

Author SHA1 Message Date
Florian Bruhin
b8467b8fef tests: Various cleanups. 2015-11-26 14:25:33 +01:00
Daniel Schadt
c12011c84d Style fixes 2015-11-21 00:10:49 +01:00
Florian Bruhin
384c753094 tests: Add ensure_not_logged to TestProcess. 2015-11-15 16:38:56 +01:00
Florian Bruhin
e9ece3d114 tests: Validate **kwargs for TestProcess.wait_for. 2015-11-13 23:26:14 +01:00
Florian Bruhin
3290048458 tests: Do custom fnmatch-like matching.
fnmatch treats [, ] and ? as shell metacharacters too, and has no way to escape
them. We need a literal [] and really only need * for filtering.
2015-11-13 07:56:59 +01:00
Florian Bruhin
0085421ec6 tests: Use __tracebackhide__ in wait_for methods. 2015-11-13 06:45:55 +01:00
Florian Bruhin
85c82b32fb tests: Only print ignored lines with invalid ones. 2015-11-12 22:13:56 +01:00
Florian Bruhin
d71618031d bdd: Decrease timeouts if not on CI. 2015-11-10 09:24:47 +01:00
Florian Bruhin
dc3bfb5eb4 bdd: Print ignored lines in testprocess. 2015-11-10 08:47:29 +01:00
Florian Bruhin
021ea444a1 bdd: Fix separations between tests.
With this change, no test should affect another one anymore. Changes in detail:

- Before each test, invalid lines are cleaned so the invalid output from the
  previous test doesn't affect the next one.
- Before each test, qutebrowser is restarted if it was quit.
- After each test, the data is cleared properly in every case.
- If there was an invalid output, the test waits for 1s for more output, and
  then terminates qutebrowser so it's restarted with a clean state.
2015-11-09 07:43:48 +01:00
Florian Bruhin
8b016df023 bdd: Make InvalidLine show some more informations. 2015-11-09 07:41:57 +01:00
Florian Bruhin
25ecd9068c tests: Don't wait for the same line twice.
We need to search for lines in the history because we could miss something
otherwise, but for subsequent wait_for calls, we really don't want to wait for
the same thing again.

This should make test_backforward.py more stable as it *actually* waits when
going back now. Before, it did produce failures such as this one on OS X:

____________________________ test_going_backforward ____________________________
[..]
    @bdd.then(bdd.parsers.parse("The requests should be:\n{pages}"))
    def list_of_loaded_pages(httpbin, pages):
        requests = [httpbin.Request('GET', '/' + path.strip())
                    for path in pages.split('\n')]
>       assert httpbin.get_requests() == requests
E       assert [Request(verb...rward/1.txt')] == [Request(verb=...rward/2.txt')]
E         At index 3 diff: Request(verb='GET', path='/data/backforward/1.txt') != Request(verb='GET', path='/data/backforward/2.txt')
E         Full diff:
E         [Request(verb='GET', path='/data/backforward/1.txt'),
E         Request(verb='GET', path='/data/backforward/2.txt'),
E         Request(verb='GET', path='/data/backforward/1.txt'),
E         -  Request(verb='GET', path='/data/backforward/1.txt')]
E         ?                                              ^
E         +  Request(verb='GET', path='/data/backforward/2.txt')]
E         ?                                              ^
tests/integration/features/conftest.py:85: AssertionError
2015-11-06 07:02:17 +01:00
Florian Bruhin
f5f74b7ddc tests: Use a base class for testprocess lines. 2015-11-06 07:02:17 +01:00
Florian Bruhin
924b0052c6 bdd: Match historic messages in wait_for.
Fixes #1083.
2015-11-05 07:07:43 +01:00
Florian Bruhin
e31240e6c9 tests: Increase wait_for default timeout again. 2015-11-03 07:54:24 +01:00
Florian Bruhin
c78bbd9fd0 tests: Show some information for WaitForTimeout. 2015-11-03 07:53:51 +01:00
Florian Bruhin
535bcab310 bdd tests: Restart qutebrowser once per module.
This should be a good compromise between reproducibility and speed.
2015-11-03 07:00:46 +01:00
Florian Bruhin
7e0e770d53 bdd: Increase timeouts. 2015-11-03 06:35:52 +01:00
Florian Bruhin
7431d7cf89 tests: Increase quteproc start timeout. 2015-11-02 08:08:36 +01:00
Florian Bruhin
b79ccb5e79 bdd: Make message matching work. 2015-11-01 22:49:39 +01:00
Florian Bruhin
239bc3bdea Connect read_log before starting process. 2015-11-01 22:48:44 +01:00
Florian Bruhin
dfc1782bbf Add testprocess.wait_for to react to messages. 2015-11-01 22:48:44 +01:00
Florian Bruhin
4b683cdd8f Check invalid logs after exiting process. 2015-11-01 22:47:58 +01:00
Florian Bruhin
1c7fd7d80e Rename testprocess cleanup to terminate. 2015-11-01 22:47:58 +01:00
Florian Bruhin
18ead66f04 Fix odd QuteProc crash. 2015-11-01 22:47:58 +01:00
Florian Bruhin
b878b139dd Ignore errors when decoding subprocess output.
This would otherwise fail on Windows because … get translated to an UTF-8 NEL
(U+0085)...
2015-11-01 22:40:11 +01:00
Florian Bruhin
c052c8a107 Don't show full debug log without --verbose. 2015-11-01 22:40:11 +01:00
Florian Bruhin
af000a8ac6 Wait longer for process to start. 2015-11-01 22:40:11 +01:00
Florian Bruhin
76fcec4e4c tests: First steps towards end-to-end tests. 2015-11-01 22:40:11 +01:00
Florian Bruhin
e6ee0c08cf testprocess: Restart process when it quits. 2015-10-14 21:52:11 +02:00
Florian Bruhin
f858af666f testprocess: Get executable/args from subclasses. 2015-10-14 21:52:11 +02:00
Florian Bruhin
2f075c382b Move out test process handling to its own file. 2015-10-10 17:20:20 +02:00