diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup')
5 files changed, 29 insertions, 0 deletions
diff --git a/testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup/conftest.py b/testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup/conftest.py new file mode 100644 index 000000000..d689c11b2 --- /dev/null +++ b/testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup/conftest.py @@ -0,0 +1,18 @@ + +import pytest + +@pytest.fixture("session") +def setup(request): + setup = CostlySetup() + request.addfinalizer(setup.finalize) + return setup + +class CostlySetup: + def __init__(self): + import time + print ("performing costly setup") + time.sleep(5) + self.timecostly = 1 + + def finalize(self): + del self.timecostly diff --git a/testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup/sub1/__init__.py b/testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup/sub1/__init__.py new file mode 100644 index 000000000..792d60054 --- /dev/null +++ b/testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup/sub1/__init__.py @@ -0,0 +1 @@ +# diff --git a/testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup/sub1/test_quick.py b/testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup/sub1/test_quick.py new file mode 100644 index 000000000..d97657867 --- /dev/null +++ b/testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup/sub1/test_quick.py @@ -0,0 +1,3 @@ + +def test_quick(setup): + pass diff --git a/testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup/sub2/__init__.py b/testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup/sub2/__init__.py new file mode 100644 index 000000000..792d60054 --- /dev/null +++ b/testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup/sub2/__init__.py @@ -0,0 +1 @@ +# diff --git a/testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup/sub2/test_two.py b/testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup/sub2/test_two.py new file mode 100644 index 000000000..6ed6ee4d8 --- /dev/null +++ b/testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup/sub2/test_two.py @@ -0,0 +1,6 @@ +def test_something(setup): + assert setup.timecostly == 1 + +def test_something_more(setup): + assert setup.timecostly == 1 + |