mirror of
https://github.com/scito/extract_otp_secret_keys.git
synced 2025-12-06 06:44:57 +01:00
- 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
22 lines
737 B
Python
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])
|