Skip to content

Instantly share code, notes, and snippets.

@bbelderbos
Created May 23, 2023 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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 [
"email1@example.com",
"email2@example.com",
"email3@example.com",
"email4@example.com",
"email5@example.com",
]
def test_get_random_emails(sample_emails):
number_emails = 3
result = get_random_emails(sample_emails, number_emails)
expected_emails = ["email1@example.com", "email3@example.com", "email5@example.com"]
assert result == expected_emails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment