diff --git a/tests/conftest.py b/tests/conftest.py index e5e3af7..984257e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,7 +7,7 @@ from _pytest.fixtures import SubRequest from earthsnake.identity import Identity -from .helpers import random_name +from .helpers import DEFAULT_IDENTITY_SEED, random_name @pytest.fixture @@ -21,6 +21,8 @@ def identity(request: SubRequest) -> Identity: for seed in marker.args: pass + seed = seed or DEFAULT_IDENTITY_SEED + for marker in request.node.iter_markers('id_name'): for name in marker.args: pass diff --git a/tests/helpers.py b/tests/helpers.py index f47e849..478fd87 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -5,6 +5,11 @@ from random import choice from earthsnake.types import ALPHA_LOWER, ALPHA_LOWER_OR_DIGIT +DEFAULT_IDENTITY_SEED = ( + b'\xe5:\xc9\x95$\x9d\xc5F\xee\xe6\x84\xbe\xcc\xda^\xc4' + b'z\x84\xb7\xd2\x02q\xfa\xe8W\xd8z\x05E\xfb2\xd5' +) + def random_name() -> str: """Generate a valid random author name""" diff --git a/tests/test_identity.py b/tests/test_identity.py index e6dfd64..712aedc 100644 --- a/tests/test_identity.py +++ b/tests/test_identity.py @@ -9,12 +9,8 @@ from pytest_mock.plugin import MockerFixture from earthsnake.exc import ValidationError from earthsnake.identity import Identity -from .helpers import random_name +from .helpers import DEFAULT_IDENTITY_SEED as TEST_SEED, random_name -TEST_SEED = ( - b'\xe5:\xc9\x95$\x9d\xc5F\xee\xe6\x84\xbe\xcc\xda^\xc4' - b'z\x84\xb7\xd2\x02q\xfa\xe8W\xd8z\x05E\xfb2\xd5' -) TEST_MNEMONIC = bip39.encode_bytes(TEST_SEED)