move some fill fixture acceptance tests contents to the examples script folder
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def arg1(request):
|
||||
with pytest.raises(Exception):
|
||||
request.getfixturevalue("arg2")
|
||||
@@ -0,0 +1,2 @@
|
||||
def test_1(arg1):
|
||||
pass
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def arg2(request):
|
||||
pytest.raises(Exception, "request.getfixturevalue('arg1')")
|
||||
@@ -0,0 +1,2 @@
|
||||
def test_2(arg2):
|
||||
pass
|
||||
@@ -0,0 +1,6 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def spam():
|
||||
return "spam"
|
||||
@@ -0,0 +1,6 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def spam(spam):
|
||||
return spam * 2
|
||||
@@ -0,0 +1,2 @@
|
||||
def test_spam(spam):
|
||||
assert spam == "spamspam"
|
||||
@@ -0,0 +1,6 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def spam():
|
||||
return "spam"
|
||||
@@ -0,0 +1,10 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def spam(spam):
|
||||
return spam * 2
|
||||
|
||||
|
||||
def test_spam(spam):
|
||||
assert spam == "spamspam"
|
||||
@@ -0,0 +1,15 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def spam():
|
||||
return "spam"
|
||||
|
||||
|
||||
class TestSpam(object):
|
||||
@pytest.fixture
|
||||
def spam(self, spam):
|
||||
return spam * 2
|
||||
|
||||
def test_spam(self, spam):
|
||||
assert spam == "spamspam"
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def some(request):
|
||||
return request.function.__name__
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def other(request):
|
||||
return 42
|
||||
|
||||
|
||||
def test_func(some, other):
|
||||
pass
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
class TestClass(object):
|
||||
@pytest.fixture
|
||||
def something(self, request):
|
||||
return request.instance
|
||||
|
||||
def test_method(self, something):
|
||||
assert something is self
|
||||
@@ -0,0 +1,15 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def something(request):
|
||||
return request.function.__name__
|
||||
|
||||
|
||||
class TestClass(object):
|
||||
def test_method(self, something):
|
||||
assert something == "test_method"
|
||||
|
||||
|
||||
def test_func(something):
|
||||
assert something == "test_func"
|
||||
@@ -0,0 +1,10 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def xyzsomething(request):
|
||||
return 42
|
||||
|
||||
|
||||
def test_func(some):
|
||||
pass
|
||||
Reference in New Issue
Block a user