- allow to use fixtures directly, i.e. without ()

- also allow scope to be determined by a dynamic function
This commit is contained in:
holger krekel
2012-10-06 21:03:55 +02:00
parent d3893dd5d1
commit cda84fb566
4 changed files with 30 additions and 9 deletions

View File

@@ -1701,7 +1701,20 @@ def test_issue117_sessionscopeteardown(testdir):
])
class TestFixtureFactory:
class TestFixtureUsages:
def test_noargfixturedec(self, testdir):
testdir.makepyfile("""
import pytest
@pytest.fixture
def arg1():
return 1
def test_func(arg1):
assert arg1 == 1
""")
reprec = testdir.inline_run()
reprec.assertoutcome(passed=1)
def test_receives_funcargs(self, testdir):
testdir.makepyfile("""
import pytest