added "docs/en" directory and moved
This commit is contained in:
17
doc/en/example/costlysetup/conftest.py
Normal file
17
doc/en/example/costlysetup/conftest.py
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
def pytest_funcarg__setup(request):
|
||||
return request.cached_setup(
|
||||
setup=lambda: CostlySetup(),
|
||||
teardown=lambda costlysetup: costlysetup.finalize(),
|
||||
scope="session",
|
||||
)
|
||||
|
||||
class CostlySetup:
|
||||
def __init__(self):
|
||||
import time
|
||||
print ("performing costly setup")
|
||||
time.sleep(5)
|
||||
self.timecostly = 1
|
||||
|
||||
def finalize(self):
|
||||
del self.timecostly
|
||||
1
doc/en/example/costlysetup/sub1/__init__.py
Normal file
1
doc/en/example/costlysetup/sub1/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
#
|
||||
3
doc/en/example/costlysetup/sub1/test_quick.py
Normal file
3
doc/en/example/costlysetup/sub1/test_quick.py
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
def test_quick(setup):
|
||||
pass
|
||||
1
doc/en/example/costlysetup/sub2/__init__.py
Normal file
1
doc/en/example/costlysetup/sub2/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
#
|
||||
6
doc/en/example/costlysetup/sub2/test_two.py
Normal file
6
doc/en/example/costlysetup/sub2/test_two.py
Normal file
@@ -0,0 +1,6 @@
|
||||
def test_something(setup):
|
||||
assert setup.timecostly == 1
|
||||
|
||||
def test_something_more(setup):
|
||||
assert setup.timecostly == 1
|
||||
|
||||
Reference in New Issue
Block a user