@@ -4498,6 +4498,9 @@ def test_class1(self, class_scope_fixture):
44984498 def test_class2(self):
44994499 print("class_scope_fixture should have been torn down")
45004500
4501+ def test_class3(self, class_scope_fixture):
4502+ print("class_scope_fixture should'nt have been torn down")
4503+
45014504 def teardown_class(self):
45024505 print("Tearing down TestClass")
45034506
@@ -4525,6 +4528,10 @@ def test_session1(session_scope_fixture):
45254528
45264529 def test_session2():
45274530 print("session_scope_fixture should have been torn down")
4531+
4532+ def test_session3(session_scope_fixture):
4533+ print("session_scope_fixture should'nt have been torn down")
4534+
45284535 """ ,
45294536 "tests/__init__.py" : """
45304537 def teardown_module():
@@ -4536,6 +4543,7 @@ def teardown_module():
45364543 assert result .ret == 0
45374544 result .stdout .fnmatch_lines (
45384545 [
4546+ "*class_scope_fixture should'nt have been torn down*" ,
45394547 "*Tearing down class_scope_fixture*" ,
45404548 "*class_scope_fixture should have been torn down*" ,
45414549 "*Tearing down TestClass*" ,
@@ -4544,6 +4552,7 @@ def teardown_module():
45444552 "*Tearing down test_module_a*" ,
45454553 "*Tearing down package_scope_fixture*" ,
45464554 "*package_scope_fixture should have been torn down*" ,
4555+ "*session_scope_fixture should'nt have been torn down*" ,
45474556 "*Tearing down session_scope_fixture*" ,
45484557 "*session_scope_fixture should have been torn down*" ,
45494558 "*Tearing down package tests*" ,
0 commit comments