MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / fixture_setup

Method fixture_setup

tests/conftest.py:154–165  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 1

preloopMethod · 0.80

Tested by

no test coverage detected