diff --git a/tests/unit/browser/test_webelem.py b/tests/unit/browser/test_webelem.py index 98c27dd71..582bf49a4 100644 --- a/tests/unit/browser/test_webelem.py +++ b/tests/unit/browser/test_webelem.py @@ -320,7 +320,7 @@ class TestWebElementWrapper: ('', ''), ('\n\n', ''), ('{}'.format('x' * 500), '{}…'.format('x' * 494)), - ]) + ], ids=['fakeelem', 'newlines', 'long']) def test_debug_text(self, elem, xml, expected): elem._elem.toOuterXml.return_value = xml assert elem.debug_text() == expected @@ -594,7 +594,7 @@ class TestJavascriptEscape: # http://qutebrowser.org:8010/builders/debian-jessie/builds/765/steps/unittests/ # Should that be ignored? - @pytest.mark.parametrize('before, after', TESTS.items()) + @pytest.mark.parametrize('before, after', TESTS.items(), ids=repr) def test_fake_escape(self, before, after): """Test javascript escaping with some expected outcomes.""" assert webelem.javascript_escape(before) == after @@ -639,7 +639,7 @@ class TestJavascriptEscape: result = webframe.evaluateJavaScript('"{}";'.format(escaped)) assert result == text - @pytest.mark.parametrize('text', TESTS) + @pytest.mark.parametrize('text', TESTS, ids=repr) def test_real_escape(self, webframe, qtbot, text): """Test javascript escaping with a real QWebPage.""" self._test_escape(text, qtbot, webframe) diff --git a/tests/unit/utils/test_debug.py b/tests/unit/utils/test_debug.py index 5fae9def6..72392e8dd 100644 --- a/tests/unit/utils/test_debug.py +++ b/tests/unit/utils/test_debug.py @@ -178,7 +178,7 @@ def test_signal_name(signal, expected): (None, {'foo': 'bar'}, "foo='bar'"), (['foo', 'bar'], {'baz': 'fish'}, "'foo', 'bar', baz='fish'"), (['x' * 300], None, "'{}".format('x' * 198 + '…')), -]) +], ids=lambda val: str(val)[:20]) def test_format_args(args, kwargs, expected): assert debug.format_args(args, kwargs) == expected @@ -201,7 +201,7 @@ def test_format_call(func, args, kwargs, full, expected): ([23, 42], 'fake(23, 42)'), (['x' * 201], "fake('{}\u2026)".format('x' * 198)), (['foo\nbar'], r"fake('foo\nbar')"), -]) +], ids=lambda val: str(val)[:20]) def test_dbg_signal(stubs, args, expected): assert debug.dbg_signal(stubs.FakeSignal(), args) == expected diff --git a/tests/unit/utils/test_error.py b/tests/unit/utils/test_error.py index 1631902ea..b2dd3e1af 100644 --- a/tests/unit/utils/test_error.py +++ b/tests/unit/utils/test_error.py @@ -75,7 +75,7 @@ def test_no_err_windows(caplog, exc, name, exc_text): ('foo', '', 'foo: exception'), ('foo', 'bar', 'foo: exception\n\nbar'), ('', 'bar', 'exception\n\nbar'), -]) +], ids=repr) def test_err_windows(qtbot, qapp, pre_text, post_text, expected): @pyqtSlot() diff --git a/tests/unit/utils/test_utils.py b/tests/unit/utils/test_utils.py index 02bed2f64..052bdb2ed 100644 --- a/tests/unit/utils/test_utils.py +++ b/tests/unit/utils/test_utils.py @@ -57,7 +57,7 @@ class TestCompactText: ('foo\nbar', 'foobar'), (' foo \n bar ', 'foobar'), ('\nfoo\n', 'foo'), - ]) + ], ids=repr) def test_compact_text(self, text, expected): """Test folding of newlines.""" assert utils.compact_text(text) == expected @@ -68,7 +68,7 @@ class TestCompactText: (5, 'foobar', 'foob' + ELLIPSIS), (5, 'foo\nbar', 'foob' + ELLIPSIS), (7, 'foo\nbar', 'foobar'), - ]) + ], ids=lambda val: str(val)[:20]) def test_eliding(self, elidelength, text, expected): """Test eliding.""" assert utils.compact_text(text, elidelength) == expected