From 16047a5b15f4235a01b68b6401d85d97c6b1c492 Mon Sep 17 00:00:00 2001 From: scito Date: Sun, 1 Jan 2023 19:19:41 +0100 Subject: [PATCH] fix test compatibility with Alpine Linux --- tests/extract_otp_secrets_test.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/extract_otp_secrets_test.py b/tests/extract_otp_secrets_test.py index cfcde0d..5532c38 100644 --- a/tests/extract_otp_secrets_test.py +++ b/tests/extract_otp_secrets_test.py @@ -466,13 +466,20 @@ def test_wrong_data(capsys: pytest.CaptureFixture[str]) -> None: # Assert captured = capsys.readouterr() - expected_stderr = ''' + first_expected_stderr = ''' ERROR: Cannot decode otpauth-migration migration payload. data=XXXX Exception: Error parsing message ''' - assert captured.err == expected_stderr + # Alpine Linux prints this exception message + second_expected_stderr = ''' +ERROR: Cannot decode otpauth-migration migration payload. +data=XXXX +Exception: unpack requires a buffer of 4 bytes +''' + + assert captured.err == first_expected_stderr or captured.err == second_expected_stderr assert captured.out == '' assert e.value.code == 1 assert e.type == SystemExit