ignore types for stdout.reconfigure

cv2_1
scito 1 year ago
parent b3fc854078
commit 003e122808

@ -15,7 +15,7 @@ ARG RUN_TESTS=true
RUN apk add --no-cache zlib jpeg \
&& echo "Arch: $(apk --print-arch)" \
&& if [[ "$(apk --print-arch)" == "aarch64" ]]; then apk add --no-cache --virtual .build-deps gcc libc-dev python3-dev py3-setuptools zlib-dev jpeg-dev; fi \
&& pip install --no-cache-dir protobuf qrcode Pillow \
&& pip install --no-cache-dir protobuf qrcode Pillow colorama \
&& if [[ "$(apk --print-arch)" == "aarch64" ]]; then apk del .build-deps; fi \
&& if [[ "$RUN_TESTS" == "true" ]]; then /extract/run_pytest.sh tests/extract_otp_secrets_test.py -k "not qreader" --relaxed; else echo "Not running tests..."; fi

@ -136,8 +136,8 @@ def main(sys_args: list[str]) -> None:
sys.stdout.close = lambda: None # type: ignore
# set encoding to utf-8, needed for Windows
try:
sys.stdout.reconfigure(encoding='utf-8')
sys.stderr.reconfigure(encoding='utf-8')
sys.stdout.reconfigure(encoding='utf-8') # type: ignore
sys.stderr.reconfigure(encoding='utf-8') # type: ignore
except AttributeError: # '_io.StringIO' object has no attribute 'reconfigure'
# StringIO in tests do not have all attributes, ignore it
pass

@ -38,7 +38,7 @@ 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")
# @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:

Loading…
Cancel
Save