File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -98,12 +98,13 @@ def pytest_runtest_makereport(item, call):
9898 outcome = yield
9999 report = outcome .get_result ()
100100 if report .when == "call" :
101+ fixture_extras = getattr (item .config , "extras" , [])
101102 plugin_extras = getattr (report , "extra" , [])
102103 report .extra = fixture_extras + plugin_extras
103104
104105
105106@pytest .fixture
106- def extra ():
107+ def extra (pytestconfig ):
107108 """Add details to the HTML reports.
108109
109110 .. code-block:: python
@@ -112,8 +113,9 @@ def extra():
112113 def test_foo(extra):
113114 extra.append(pytest_html.extras.url('http://www.example.com/'))
114115 """
115- del fixture_extras [:]
116- return fixture_extras
116+ pytestconfig .extras = []
117+ yield pytestconfig .extras
118+ del pytestconfig .extras [:]
117119
118120
119121def data_uri (content , mime_type = "text/plain" , charset = "utf-8" ):
You can’t perform that action at this time.
0 commit comments