Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor tests to use pytest.mark.parametrize #23

Open
AbhinavOmprakash opened this issue Dec 1, 2021 · 0 comments
Open

Refactor tests to use pytest.mark.parametrize #23

AbhinavOmprakash opened this issue Dec 1, 2021 · 0 comments
Labels
good first issue Good for newcomers

Comments

@AbhinavOmprakash
Copy link
Owner

Currently most tests have asserts inside one function like this

def test_is_even():
    assert is_even(2) == True
    assert is_even(3) == False

instead this should be refactored to be

@pytest.mark.parametrize(
    "input, expected",
    [
        (2, True),
        (1, False),
    ],
)
def test_is_even(input, expected):
    assert is_even(input) == expected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant