Fix factory-reset.
[gnuk/gnuk.git] / tests / conftest.py
1 import pytest
2 from card_reader import get_ccid_device
3 from openpgp_card import OpenPGP_Card
4
5 def pytest_addoption(parser):
6     parser.addoption("--reader", dest="reader", type=str, action="store",
7                      default="gnuk", help="specify reader: gnuk or gemalto")
8
9 @pytest.fixture(scope="session")
10 def card():
11     print()
12     print("Test start!")
13     reader = get_ccid_device()
14     print("Reader:", reader.get_string(1), reader.get_string(2))
15     card = OpenPGP_Card(reader)
16     card.cmd_select_openpgp()
17     yield card
18     del card