Created
June 3, 2014 00:14
-
-
Save jasonkeene/10bbb26e1990e4c32227 to your computer and use it in GitHub Desktop.
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 Fixture(): | |
@property | |
def foo(self): | |
raise NotImplementedError | |
@pytest.fixture | |
def myfix(): | |
return Fixture() | |
@pytest.fixture | |
def child_fix1(myfix): | |
myfix.foo = "bar" | |
return myfix | |
@pytest.fixture | |
def child_fix2(myfix): | |
myfix.foo = "baz" | |
return myfix | |
def test_things(myfix, child_fix1, child_fix2): | |
with pytest.raises(NotImplementedError): | |
myfix.foo | |
assert child_fix1.foo == "bar" | |
assert child_fix2.foo == "baz" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment