burn_tests: ensure burntest does not block pytest

pytest discovers test_*.py and *_test.py, so it should be hidden now
in addition, the code should only run when the script is run explicitly,
not when imported
pull/25/head
matejcik 5 years ago
parent 49b71e8081
commit 3db07338ed

@ -37,25 +37,26 @@ def get_device():
raise RuntimeError("No debuggable device found")
wirelink = get_device()
client = TrezorClientDebugLink(wirelink)
client.open()
device.wipe(client)
device.reset(client, no_backup=True)
i = 0
while True:
# set private field
device.apply_settings(client, use_passphrase=True)
assert client.features.passphrase_protection is True
device.apply_settings(client, use_passphrase=False)
assert client.features.passphrase_protection is False
# set public field
label = "".join(random.choices(string.ascii_uppercase + string.digits, k=17))
device.apply_settings(client, label=label)
assert client.features.label == label
print("iteration %d" % i)
i = i + 1
if __name__ == "__main__":
wirelink = get_device()
client = TrezorClientDebugLink(wirelink)
client.open()
device.wipe(client)
device.reset(client, no_backup=True)
i = 0
while True:
# set private field
device.apply_settings(client, use_passphrase=True)
assert client.features.passphrase_protection is True
device.apply_settings(client, use_passphrase=False)
assert client.features.passphrase_protection is False
# set public field
label = "".join(random.choices(string.ascii_uppercase + string.digits, k=17))
device.apply_settings(client, label=label)
assert client.features.label == label
print("iteration %d" % i)
i = i + 1
Loading…
Cancel
Save