Skip to content

Instantly share code, notes, and snippets.

@bbelderbos
Created May 23, 2023 13:30
Show Gist options
  • Save bbelderbos/b9e6a583738a509ba07df9dab4eb962c to your computer and use it in GitHub Desktop.
Save bbelderbos/b9e6a583738a509ba07df9dab4eb962c to your computer and use it in GitHub Desktop.
import random
import pytest
from script import get_random_emails
@pytest.fixture(autouse=True)
def set_random_seed():
random.seed(123)
@pytest.fixture
def sample_emails():
return [
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
]
def test_get_random_emails(sample_emails):
number_emails = 3
result = get_random_emails(sample_emails, number_emails)
expected_emails = ["[email protected]", "[email protected]", "[email protected]"]
assert result == expected_emails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment