fix finput encoding problem on Windows

This commit is contained in:
scito
2022-12-31 21:24:01 +01:00
parent 739ae4c012
commit 5be6e9c322
3 changed files with 6 additions and 4 deletions

View File

@@ -36,6 +36,10 @@ from utils import (file_exits, quick_and_dirty_workaround_encoding_problem,
qreader_available: bool = extract_otp_secrets.qreader_available
# Quickfix comment
#@pytest.mark.skipif(sys.platform.startswith("win") or not qreader_available or sys.implementation.name == 'pypy', reason="Quickfix")
def test_extract_stdout(capsys: pytest.CaptureFixture[str]) -> None:
# Act
extract_otp_secrets.main(['example_export.txt'])
@@ -91,7 +95,6 @@ def test_extract_stdin_empty(capsys: pytest.CaptureFixture[str], monkeypatch: py
assert captured.err == 'WARN: stdin is empty\n'
# @pytest.mark.skipif(not qreader_available, reason='Test if cv2 and qreader are not available.')
def test_extract_empty_file_no_qreader(capsys: pytest.CaptureFixture[str]) -> None:
if qreader_available:
# Act
@@ -351,7 +354,6 @@ def test_normalize_bytes() -> None:
'Before\\\\302\\\\277\\\\303\nname: enc: \\302\\277\\303\\244\\303\\204\\303\\251\\303\\211?\nAfter') == 'Before\\\\302\\\\277\\\\303\nname: enc: ¿äÄéÉ?\nAfter'
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Avoid encoding problems")
def test_extract_verbose(capsys: pytest.CaptureFixture[str], relaxed: bool) -> None:
# Act
extract_otp_secrets.main(['-v', 'example_export.txt'])

View File

@@ -171,7 +171,7 @@ Type: totp
self.assertEqual(count_files_in_dir('testout/qr'), 6)
def test_extract_verbose(self) -> None:
if sys.implementation.name == 'pypy' or sys.platform.startswith("win"):
if sys.implementation.name == 'pypy':
self.skipTest("Avoid encoding problems")
out = io.StringIO()
with redirect_stdout(out):