diff --git a/pytest.ini b/pytest.ini index 1dc9e3ba5..0cc5e49aa 100644 --- a/pytest.ini +++ b/pytest.ini @@ -26,6 +26,7 @@ markers = no_invalid_lines: Don't fail on unparseable lines in end2end tests issue2478: Tests which are broken on Windows with QtWebEngine, https://github.com/qutebrowser/qutebrowser/issues/2478 fake_os: Fake utils.is_* to a fake operating system + unicode_locale: Tests which need an unicode locale to work qt_log_level_fail = WARNING qt_log_ignore = ^SpellCheck: .* diff --git a/tests/conftest.py b/tests/conftest.py index 301658d56..0c28ed17b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -63,6 +63,8 @@ def _apply_platform_markers(config, item): ('no_ci', 'CI' in os.environ, "Skipped on CI."), ('issue2478', utils.is_windows and config.webengine, "Broken with QtWebEngine on Windows"), + ('unicode_locale', sys.getfilesystemencoding() == 'ascii', + "Skipped because of ASCII locale"), ] for searched_marker, condition, default_reason in markers: diff --git a/tests/end2end/features/history.feature b/tests/end2end/features/history.feature index 86e5d6f00..aa126c4f7 100644 --- a/tests/end2end/features/history.feature +++ b/tests/end2end/features/history.feature @@ -32,6 +32,7 @@ Feature: Page history Then the history should contain: http://localhost:(port)/data/title%20with%20spaces.html Test title + @unicode_locale Scenario: History item with umlauts When I open data/äöü.html Then the history should contain: diff --git a/tests/unit/commands/test_userscripts.py b/tests/unit/commands/test_userscripts.py index 9a6490aca..32f9a1bb9 100644 --- a/tests/unit/commands/test_userscripts.py +++ b/tests/unit/commands/test_userscripts.py @@ -241,9 +241,8 @@ def test_unicode_error(caplog, qtbot, py_proc, runner): runner.store_html('') assert len(caplog.records) == 1 - expected = ("Invalid unicode in userscript output: 'utf-8' codec can't " - "decode byte 0x80 in position 0: invalid start byte") - assert caplog.records[0].message == expected + expected = "Invalid unicode in userscript output: " + assert caplog.records[0].message.startswith(expected) @pytest.mark.fake_os('unknown')