Created
November 18, 2015 22:42
-
-
Save dnephin/b55565ef1921c8070a1c to your computer and use it in GitHub Desktop.
py.test autouse session fixture in 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
# |
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 | |
@pytest.fixture(autouse=True, scope='session') | |
def doit_global(): | |
print "GOOOOOD" |
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 unittest | |
class TestSomething(unittest.TestCase): | |
def test_something(self): | |
assert True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I run
py.test -vs tests/file_test.py
I seeGOOOOOD
printed