Created
January 12, 2015 23:27
-
-
Save ionelmc/d482203a2eea760301f8 to your computer and use it in GitHub Desktop.
Pytest fixture linting
This file contains 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
# This should not emit any complaints | |
import pytest | |
class App: | |
def __init__(self, smtp): | |
self.smtp = smtp | |
@pytest.fixture(scope="module") | |
def app(smtp): | |
return App(smtp) | |
def test_smtp_exists(aap): # Ooooops. TYPO! | |
assert app.smtp # This will fail with horribly contrived error |
This file contains 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
# This should not emit any complaints | |
import pytest | |
class App: | |
def __init__(self, smtp): | |
self.smtp = smtp | |
@pytest.fixture(scope="module") | |
def app(smtp): | |
return App(smtp) | |
def test_smtp_exists(app): | |
assert app.smtp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment