@@ -130,3 +130,90 @@ def test_nested_fixtures(executed_docstring_source):
130130 )
131131 )
132132 )
133+
134+
135+ @allure .feature ("Fixture" )
136+ def test_fixture_allure_title (allured_testdir ):
137+ allured_testdir .testdir .makepyfile ("""
138+ import pytest
139+ import allure
140+
141+ @pytest.fixture
142+ @allure.title("Allure fixture title")
143+ def first_fixture():
144+ pass
145+
146+ def test_titled_fixture_example(first_fixture):
147+ pass
148+ """ )
149+
150+ allured_testdir .run_with_allure ()
151+
152+ assert_that (allured_testdir .allure_report ,
153+ has_test_case ("test_titled_fixture_example" ,
154+ has_container (allured_testdir .allure_report ,
155+ has_before ("Allure fixture title" )
156+ )
157+ )
158+ )
159+
160+
161+ @allure .feature ("Fixture" )
162+ def test_fixture_allure_title_before (allured_testdir ):
163+ allured_testdir .testdir .makepyfile ("""
164+ import pytest
165+ import allure
166+
167+ @allure.title("Allure fixture title")
168+ @pytest.fixture
169+ def first_fixture():
170+ pass
171+
172+ def test_titled_before_fixture_example(first_fixture):
173+ pass
174+ """ )
175+
176+ allured_testdir .run_with_allure ()
177+
178+ assert_that (allured_testdir .allure_report ,
179+ has_test_case ("test_titled_before_fixture_example" ,
180+ has_container (allured_testdir .allure_report ,
181+ has_before ("Allure fixture title" )
182+ )
183+ )
184+ )
185+
186+
187+ def test_titled_fixture_from_conftest (allured_testdir ):
188+ allured_testdir .testdir .makeconftest ("""
189+ import allure
190+ import pytest
191+
192+ @allure.title('Titled fixture before pytest.fixture')
193+ @pytest.fixture
194+ def first_fixture():
195+ pass
196+
197+ @pytest.fixture
198+ @allure.title('Titled fixture after pytest.fixture')
199+ def second_fixture():
200+ pass
201+ """ )
202+
203+ allured_testdir .testdir .makepyfile ("""
204+ def test_with_titled_conftest_fixtures(first_fixture, second_fixture):
205+ pass
206+ """ )
207+
208+ allured_testdir .run_with_allure ()
209+
210+ assert_that (allured_testdir .allure_report ,
211+ has_test_case ("test_with_titled_conftest_fixtures" ,
212+ has_container (allured_testdir .allure_report ,
213+ has_before ("Titled fixture before pytest.fixture" )
214+ ),
215+ has_container (allured_testdir .allure_report ,
216+ has_before ("Titled fixture after pytest.fixture" )
217+ )
218+ )
219+ )
0 commit comments