Commit Graph

152 Commits

Author SHA1 Message Date
Florian Bruhin
30327b2acf Move end2end tag handling to end2end/conftest.py 2016-09-05 15:08:00 +02:00
Florian Bruhin
6c6e98aac4 Add a @qtwebkit_skip marker 2016-09-05 15:08:00 +02:00
Florian Bruhin
187bfa8fce tests: Use pytest_register_assert_rewrite 2016-08-26 06:22:03 +02:00
Florian Bruhin
6b4f719897 Revert "tests: Add a autouse fixture as workaround"
This reverts commit 853f4cd9d8.
2016-08-24 07:23:00 +02:00
Florian Bruhin
0c6574afb1 Replace py.test with pytest
See #1877
2016-08-22 07:41:10 +02:00
Florian Bruhin
853f4cd9d8 tests: Add a autouse fixture as workaround
This is a workaround for
https://github.com/pytest-dev/pytest/issues/1832
2016-08-22 07:24:17 +02:00
Florian Bruhin
003952748b Turn on BDD tests for pytest 3.0 again
pytest-bdd is fixed in the respective PR
2016-08-19 17:17:08 +02:00
Florian Bruhin
ec59bfb584 bdd: Handle @qtwebengine_skip tag 2016-08-18 20:33:53 +02:00
Florian Bruhin
3dccd15663 bdd: Handle @qtwebengine_todo tags 2016-08-18 17:41:34 +02:00
Florian Bruhin
323b181227 Automatically skip BDD tests on pytest 3.0
See https://github.com/pytest-dev/pytest-bdd/pull/193
This at least allows us to play with pytest 3.0 a bit...
2016-08-05 14:36:32 +02:00
Florian Bruhin
7605a4fb0c tests: Use pytest-warnings to handle warnings 2016-07-27 18:28:08 +02:00
Florian Bruhin
d91c922b4c Add --qute-bdd-webengine switch for end2end tests 2016-07-11 17:24:03 +02:00
Florian Bruhin
dece5dda78 Add a docstring for pytest_bdd_apply_tag 2016-06-30 17:42:17 +02:00
Florian Bruhin
ead437be82 Don't define pytest_bdd_apply_tag when frozen
This should help with the undefined hook while not requiring to install
the pytest-bdd plugin when frozen.
2016-06-30 17:40:54 +02:00
Florian Bruhin
50c1d85137 Use raw string for regex 2016-06-30 15:46:38 +02:00
Florian Bruhin
eb463ab2d3 Fix pytest-bdd tags 2016-06-30 14:47:55 +02:00
Florian Bruhin
8d9a699b5b test requirements: Update to pytest-bdd 2.17.0
This also allows us to have dynamic pyqt>=5.3.1 etc. tags.
2016-06-30 14:02:30 +02:00
Florian Bruhin
9e1d20017c tests: Mark "History with an error" as flaky
For some reason, sometimes on Travis the history file we read is empty.
I have no idea why though, as we successfully wait until ":save saved
history" is logged, and that is working fine.

Let's just mark the test as flaky for now so we can move on.
2016-06-09 11:17:18 +02:00
Florian Bruhin
8e2d315807 Fix pytest_status workaround if .cache is missing 2016-05-29 22:21:35 +02:00
Florian Bruhin
001670969b tests: Ignore segfaults on pytest exit
In various situations (especially on OS X), pytest segfaults on exit probably
due to Qt/PyQt bugs.

We now have a wrapper script which ignores those segfaults if pytest did run
successfully.
2016-05-29 22:06:24 +02:00
Florian Bruhin
64d4c9f83e Clean up end2end test file structure
This renames tests/integration to tests/end2end and moves some files to
tests/end2end/fixtures.
2016-05-29 18:20:00 +02:00
Florian Bruhin
9ea7716b06 Stop supporting running tests without Xvfb/DISPLAY
This always caused problems and unneeded complexity in the past, and it
also increases Travis CI runtime.

We now require either a DISPLAY during tests or Xvfb being installed.
2016-04-06 08:27:43 +02:00
Florian Bruhin
d1ec64cab1 Remove skip marker as it's builtin in pytest now 2016-03-02 07:14:06 +01:00
Florian Bruhin
48f87d1656 Revert "Use pytest-platform-markers"
This reverts commit 2e12fb3c65.

It seems like it's currently broken...
2016-02-27 02:45:34 +01:00
Florian Bruhin
2e12fb3c65 Use pytest-platform-markers 2016-02-27 00:26:24 +01:00
Florian Bruhin
f64916b516 Only run geolocation tests on CI
Trying to get the device location while running the tests can trigger all kind
of funny effects.

Since we can't easily mock the GPS responses, we only run those on the CI where
we at least have some predictable setup.

Fixes #1297.
2016-02-21 17:24:33 +01:00
Florian Bruhin
5c617b861c Switch to pytest-xvfb. Fixes #1309. 2016-02-16 20:36:23 +01:00
Florian Bruhin
aa579d76c9 Merge branch 'fix/#1308' of https://github.com/NoctuaNivalis/qutebrowser into NoctuaNivalis-fix/#1308 2016-02-15 22:08:33 +01:00
Felix Van der Jeugt
60c2b9c0b2 fixes #1308 2016-02-15 21:59:09 +01:00
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
83dc390808 tests: Move fixtures into a separate file. 2016-02-04 07:27:23 +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
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
Florian Bruhin
14ff684e99 bdd: Add a xfail_norun marker. 2016-01-14 07:53:00 +01:00
Florian Bruhin
22d255f49f bdd: Skip JS prompt() tests on PyQt < 5.3.1.
Those versions had a PyQt bug when overloading javaScriptPrompt, so we don't do
that there.
2016-01-12 09:04:03 +01:00
Florian Bruhin
70cd18fc98 100% coverage for mainwindow/statusbar/prompt.py. 2016-01-11 07:14:51 +01:00
Florian Bruhin
97d5342f0c Adjust hypothesis setting for 2.0. 2016-01-10 21:57:06 +01:00
Florian Bruhin
b1b767ed96 tests: Don't start Xvfb for unittests-nodisp. 2016-01-06 08:36:40 +01:00
Florian Bruhin
1619b89df7 pytest: Add a skip mark for use with bdd. 2016-01-06 07:14:30 +01:00
Florian Bruhin
a5f2ac5f03 Adjust copyright years. 2016-01-04 07:12:39 +01:00
Florian Bruhin
c1d3a94936 Don't pass through shifted characters.
See #1207 - turns out that was a problem for *any* character.
2016-01-04 07:10:23 +01:00
Florian Bruhin
9f64dfb3b6 Skip all tests using py_proc when frozen. 2015-12-21 09:46:30 +01:00
Florian Bruhin
2b1622b34d Update to pytest-bdd 2.16.0.
This avoids deprecation warnings emitted by python 3.5 and pytest 2.8.
2015-12-20 20:11:49 +01:00
Florian Bruhin
7f83c6c5c8 pylint: Disable no-member for hypothesis.Settings.
hypothesis.Settings.default is probably created dynamically.
2015-12-15 18:57:14 +01:00
Florian Bruhin
4a58e10e09 Enable hypothesis' strict mode. 2015-12-15 18:09:52 +01:00
Florian Bruhin
5817b47f75 Revert "Use fully qualified imports in tests."
Seems like this also breaks frozen tests...
This reverts commit c7fdcc92b8.
2015-12-01 22:45:59 +01:00
Florian Bruhin
c7fdcc92b8 Use fully qualified imports in tests.
This is cleaner even if pylint can't handle it.
2015-12-01 22:03:59 +01:00
Florian Bruhin
788a096150 pylint: Ignore import-error globally for tests. 2015-12-01 22:03:59 +01:00
Florian Bruhin
150a83d8f4 pylint: Remove unneeded supressions. 2015-12-01 22:03:58 +01:00
Florian Bruhin
be4cf19bb1 tests: Improve some parametrized test IDs. 2015-11-27 16:25:25 +01:00
Florian Bruhin
edf5463007 tests: Fix cmdline_test generation.
We accidentally provided valid values twice and invalid values not at all.
2015-11-27 16:17:07 +01:00
Florian Bruhin
542d13b70d tests: Add a not_xvfb marker. 2015-11-24 16:17:07 +01:00
Florian Bruhin
ea06c64ed4 Fix typos. 2015-11-23 11:17:26 +01:00
Florian Bruhin
55992337b8 bdd: Add a --qute-delay argument. 2015-11-18 20:01:40 +01:00
Florian Bruhin
1da7996c3b Style fixes. 2015-11-13 22:27:41 +01:00
Florian Bruhin
416cfaf002 tests: Switch from pytest-capturelog to catchlog. 2015-11-11 19:57:03 +01:00
Florian Bruhin
ce6ba605e4 Reorganize bdd tests. 2015-11-02 20:32:15 +01:00
Florian Bruhin
7d17957e90 Ignore inspect.getargspec() warning during tests.
https://github.com/pytest-dev/pytest-bdd/issues/153
2015-11-01 22:40:11 +01:00
Florian Bruhin
20bd1cc5fd Fix tests with 'DISPLAY='. 2015-10-08 06:36:38 +02:00
Florian Bruhin
0845671165 Start Xvfb for CI from tests. 2015-10-07 23:05:39 +02:00
Florian Bruhin
52ced6c652 Start Xvfb for tests.
Fixes #851.
2015-10-07 16:54:46 +02:00
Florian Bruhin
2c719006cf tests: Fix skipping with multiple platform markers. 2015-10-02 10:39:21 +02:00
Florian Bruhin
240e271b0d tests: Translate platform markers to skipif marks.
This means pytest shows the correct location and the marks work correctly when
marking individual items in a parametrize marker.
2015-10-02 09:26:33 +02:00
Florian Bruhin
b88a22b139 tests: Add a not_osx platform marker. 2015-10-02 08:51:40 +02:00
Florian Bruhin
9f7836131d tests: Add a reason argument to platform markers. 2015-10-02 08:51:22 +02:00
Florian Bruhin
65891c6f0d Fail tests on Python warnings.
Fixes #982.
2015-10-01 21:34:00 +02:00
Florian Bruhin
1e5028a7f3 Allow unittests-nodisp to run w/o DISPLAY on CI. 2015-09-28 22:19:33 +02:00
Florian Bruhin
1861b0a5e4 Don't skip all tests without DISPLAY set.
We used qapp in a session scoped fixture, which means testing without DISPLAY
skipped all tests.
2015-09-28 21:50:44 +02:00
Florian Bruhin
d887bbeb24 Revert "standarddir: Fix runtime basedir test on OS X."
This reverts commit 46ac1e2bf90f1c74a1cc502e08b717715b90eb39.
2015-09-15 22:31:37 +02:00
Florian Bruhin
89b4adf158 standarddir: Fix runtime basedir test on OS X. 2015-09-15 22:31:37 +02:00
Florian Bruhin
37a2523bff Add a py_proc fixture to conftest.py. 2015-09-09 19:39:01 +02:00
Florian Bruhin
34bd000442 Use shorter names.
The typical test path for a legacy FIFO was something like:

    /tmp/pytest-92/test_correct_socket_name0/qutebrowser_test/qutebrowser-ipc-dfc627b5be8602ea0e9cd258b73c0bc3

This is probably too long for a Unix local domain socket (104 chars max).
2015-09-09 19:31:52 +02:00
Florian Bruhin
9d9372c6a8 Add standarddir.temp(). 2015-09-09 19:31:52 +02:00
Florian Bruhin
0b911d2e20 Split integration tests, run smoke via pytest. 2015-09-01 08:54:53 +02:00
Florian Bruhin
6df00f8266 Move cookiejar_and_cache fixture to conftest.py. 2015-08-30 23:11:23 +02:00
Florian Bruhin
4f250ba5d7 tests: Allow tests to add windows to win_registry. 2015-08-24 08:00:16 +02:00
Florian Bruhin
70243d6e2f Fix argparser test after win_registry change.
The last focused window was now window 1 - so we better make this explicit.
2015-08-23 22:37:27 +02:00
Florian Bruhin
9ff97d31da tests: Provide two windows in win_registry fixture. 2015-08-23 21:55:12 +02:00
Florian Bruhin
0907d8bf76 tests: Add a webview fixture. 2015-08-23 18:17:22 +02:00
Florian Bruhin
1ddd65304a tests: Use a real signal for ConfigStub. 2015-08-19 19:37:19 +02:00
Florian Bruhin
6d1b0ba260 Clean up conftest.py. 2015-08-18 20:43:42 +02:00
Florian Bruhin
2c5269acd6 Reorganize tests directory. 2015-08-18 20:19:02 +02:00
Florian Bruhin
d8734a668c Add workaround for pytest-capturelog bug.
This should fix the tests on Windows.
See https://bitbucket.org/memedough/pytest-capturelog/issues/7/
2015-08-18 08:06:41 +02:00
Florian Bruhin
e909b1f36d Fix lint. 2015-08-16 23:20:30 +02:00
Florian Bruhin
6656e6aa9b Merge branch 'command-tests' 2015-08-16 22:48:07 +02:00
Florian Bruhin
2fe1bcfc2b Skip GUI tests when no DISPLAY is available.
Fixes #851.
2015-08-09 22:45:24 +02:00
Florian Bruhin
c4ebfcd4b3 Make tests fail on unexpected logging messages. 2015-08-09 20:00:36 +02:00
Florian Bruhin
43266ac08a webelem: Add more tests. 2015-08-03 23:40:39 +02:00
Florian Bruhin
a02055414d Make command tests work. 2015-07-20 11:23:34 +02:00
Florian Bruhin
0037b0db7e Actually run OS X tests on OS X. 2015-07-11 20:14:26 +02:00
Florian Bruhin
3f13c2bd3e Add/improve tests for qutebrowser.utils.urlutils. 2015-07-06 17:10:57 +02:00
Florian Bruhin
9b264c7514 tests: Share common markers. 2015-06-28 22:58:48 +02:00
Florian Bruhin
f9876823b8 Add a new config_stub fixture.
This replaces various other constructs:

- The default_config fixture - this means the config values used by
  test_progress.py are set explicitly and the (rather complex) default config
  is mocked out.

- stubs.ConfigStub which was created by the tests manually before.
2015-05-07 22:56:31 +02:00
Bruno Oliveira
2d19708a41 Play nice with other plugins in conftest.py
Some plugins might create their own Item subclasses without
a `fixturenames` attribute. Discovered while taking pytest-flakes
for a spin.
2015-04-19 17:11:29 -03:00
Florian Bruhin
10214a8b83 Merge pull request #23 from hackebrot/single-qnam
Use a single QNetworkAccessManager per session.
2015-04-14 07:00:25 +02:00
Florian Bruhin
e8ddd9397d Use a single QNetworkAccessManager per session. 2015-04-13 22:34:30 +02:00
Florian Bruhin
3433a1ec7a Add tests for CommandRunner/KeyConfigParser. 2015-04-13 07:54:24 +02:00
Florian Bruhin
343a091aee Small docstring cleanup. 2015-04-09 06:42:34 +02:00
Bruno Oliveira
d375ddebea Add new-line at the end of conftest.py 2015-04-08 19:16:45 -03:00
Bruno Oliveira
894a2a4e7b Add custom "gui" marker to tests which use qtbot fixture
Fixes #15
2015-04-08 19:14:06 -03:00