Replicates the behavior of `cmdloop()` to prepare the application state for testing. This method runs all preloop hooks and the preloop method to ensure the application is in the correct state before running a test. :type self: cmd2.Cmd
(self)
| 152 | self._in_py = False |
| 153 | |
| 154 | def fixture_setup(self): |
| 155 | """Replicates the behavior of `cmdloop()` to prepare the application state for testing. |
| 156 | |
| 157 | This method runs all preloop hooks and the preloop method to ensure the |
| 158 | application is in the correct state before running a test. |
| 159 | |
| 160 | :type self: cmd2.Cmd |
| 161 | """ |
| 162 | |
| 163 | for func in self._preloop_hooks: |
| 164 | func() |
| 165 | self.preloop() |
| 166 | |
| 167 | def fixture_teardown(self): |
| 168 | """Replicates the behavior of `cmdloop()` to tear down the application after a test. |