From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- .../pytest/doc/en/example/costlysetup/conftest.py | 18 ++++++++++++++++++ .../pytest/doc/en/example/costlysetup/sub1/__init__.py | 1 + .../doc/en/example/costlysetup/sub1/test_quick.py | 3 +++ .../pytest/doc/en/example/costlysetup/sub2/__init__.py | 1 + .../pytest/doc/en/example/costlysetup/sub2/test_two.py | 6 ++++++ 5 files changed, 29 insertions(+) create mode 100644 testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup/conftest.py create mode 100644 testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup/sub1/__init__.py create mode 100644 testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup/sub1/test_quick.py create mode 100644 testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup/sub2/__init__.py create mode 100644 testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup/sub2/test_two.py (limited to 'testing/web-platform/tests/tools/pytest/doc/en/example/costlysetup') 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 + -- cgit v1.2.3