mirror of
https://github.com/scito/extract_otp_secrets.git
synced 2025-12-13 02:09:53 +01:00
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
This commit is contained in:
22
tests/conftest.py
Normal file
22
tests/conftest.py
Normal file
@@ -0,0 +1,22 @@
|
||||
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])
|
||||
Reference in New Issue
Block a user