Beispiel #1
0
        def test_something():

            assert not slash.is_in_cleanup()
            assert slash.get_current_cleanup_phase() is None

            def session_cleanup():
                assert slash.is_in_cleanup()
                assert slash.get_current_cleanup_phase() == 'session'

            slash.add_cleanup(session_cleanup, scope='session')

            def module_cleanup():
                assert slash.is_in_cleanup()
                assert slash.get_current_cleanup_phase() == 'module'

            slash.add_cleanup(module_cleanup, scope='module')

            def regular_cleanup():
                assert slash.is_in_cleanup()
                assert slash.get_current_cleanup_phase() == 'test'

            slash.add_cleanup(regular_cleanup)
Beispiel #2
0
 def regular_cleanup():
     assert slash.is_in_cleanup()
     assert slash.get_current_cleanup_phase() == 'test'
Beispiel #3
0
 def module_cleanup():
     assert slash.is_in_cleanup()
     assert slash.get_current_cleanup_phase() == 'module'
Beispiel #4
0
 def session_cleanup():
     assert slash.is_in_cleanup()
     assert slash.get_current_cleanup_phase() == 'session'