extract_otp_secret_keys/tests/conftest.py
scito 4ba0fad000 capture QR codes from camera and major refactoring
- add GUI for QR code capturing from camera (CV2 is used)
- support different QR readers: ZBAR,QREADER,QREADER_DEEP,CV2,CV2_WECHAT
- support several input files
- add option to ignore duplicate otps
- write warnings and errors to stderr
- add output coloring
- rename project from extract_otp_secret_keys to extract_otp_secrets
- improve help
- clean verbose level output
- use Python type hints and check with mypy
- use f-strings
- clean up code
- add more tests
- calculate code coverage
- use src-layout: move files and folders
- support wheel packing
- enhance README.md
- bugfixes
    * fix -k -
    * fix utf-8 encoding on windows
2023-01-03 00:28:32 +01:00

22 lines
737 B
Python

from typing import Any
import pytest
from extract_otp_secrets import QRMode
def pytest_addoption(parser: pytest.Parser) -> None:
parser.addoption("--relaxed", action='store_true', help="run tests in relaxed mode")
parser.addoption("--fast", action="store_true", help="faster execution, do not run all combinations")
@pytest.fixture
def relaxed(request: pytest.FixtureRequest) -> Any:
return request.config.getoption("--relaxed")
def pytest_generate_tests(metafunc: pytest.Metafunc) -> None:
if "qr_mode" in metafunc.fixturenames:
number = 2 if metafunc.config.getoption("fast") else len(QRMode)
qr_modes = [mode.name for mode in QRMode]
metafunc.parametrize("qr_mode", qr_modes[0:number])