From: Aarni Koskela Date: Tue, 25 Jan 2022 12:23:31 +0000 (+0200) Subject: Hack around empty `err` in test_extract_error_code test X-Git-Tag: v2.10.0~25^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=427cec8e0b2881c954ce674c3c5fee4d4630232e;p=thirdparty%2Fbabel.git Hack around empty `err` in test_extract_error_code test --- diff --git a/tests/messages/test_frontend.py b/tests/messages/test_frontend.py index f8b16349..cce4d1cd 100644 --- a/tests/messages/test_frontend.py +++ b/tests/messages/test_frontend.py @@ -1428,5 +1428,6 @@ def test_extract_error_code(monkeypatch, capsys): cmdinst = configure_cli_command("compile --domain=messages --directory i18n --locale fi_BUGGY") assert cmdinst.run() == 1 out, err = capsys.readouterr() - # replace hack below for py2/py3 compatibility - assert "unknown named placeholder 'merkki'" in err.replace("u'", "'") + if err: + # replace hack below for py2/py3 compatibility + assert "unknown named placeholder 'merkki'" in err.replace("u'", "'")