Created
December 16, 2018 01:56
-
-
Save zkan/61be783285143a683d2faae6afa27b8b to your computer and use it in GitHub Desktop.
FizzBuzz test using Pytest with external plugin loading: conftest.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
class FizzBuzz: | |
def say(self, number): | |
if number % 3 == 0 and number % 5 == 0: | |
return 'FizzBuzz' | |
elif number % 3 == 0: | |
return 'Fizz' | |
elif number % 5 == 0: | |
return 'Buzz' | |
else: | |
return number | |
@pytest.fixture | |
def fizzbuzz(): | |
f = FizzBuzz() | |
return f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment