We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6fc08c commit 0ac11b1Copy full SHA for 0ac11b1
seleniumbase/plugins/pytest_plugin.py
@@ -384,6 +384,26 @@ def pytest_runtest_teardown(item):
384
pass
385
386
387
+@pytest.fixture()
388
+def sb(request):
389
+ from seleniumbase import BaseCase
390
+
391
+ class BaseClass(BaseCase):
392
+ def base_method():
393
+ pass
394
395
+ if request.cls:
396
+ request.cls.sb = BaseClass("base_method")
397
+ request.cls.sb.setUp()
398
+ yield request.cls.sb
399
+ request.cls.sb.tearDown()
400
+ else:
401
+ sb = BaseClass("base_method")
402
+ sb.setUp()
403
+ yield sb
404
+ sb.tearDown()
405
406
407
@pytest.mark.hookwrapper
408
def pytest_runtest_makereport(item, call):
409
pytest_html = item.config.pluginmanager.getplugin('html')
0 commit comments