MCPcopy Index your code
hub / github.com/saltstack/salt / run

Method run

tests/support/unit.py:184–212  ·  view source on GitHub ↗
(self, result=None)

Source from the content-addressed store, hash-verified

182 # cls._chdir_counter += 1
183
184 def run(self, result=None):
185 self._prerun_instance_attributes = dir(self)
186 self.maxDiff = None
187 outcome = super().run(result=result)
188 for attr in dir(self):
189 if attr == "_prerun_instance_attributes":
190 continue
191 if attr in getattr(self.__class__, "_prerun_class_attributes", ()):
192 continue
193 if attr not in self._prerun_instance_attributes:
194 attr_value = getattr(self, attr, None)
195 if attr_value is None:
196 continue
197 if isinstance(attr_value, (bool, str, int)):
198 setattr(self, attr, None)
199 continue
200 log.warning(
201 "Deleting extra class attribute after test run: %s.%s(%s). "
202 "Please consider using 'del self.%s' on the test case "
203 "'tearDown()' method",
204 self.__class__.__name__,
205 attr,
206 getattr(self, attr),
207 attr,
208 )
209 delattr(self, attr)
210 self._prerun_instance_attributes = None
211 del self._prerun_instance_attributes
212 return outcome
213
214 def assertDictContainsSubset(self, subset, dictionary, msg=None):
215 """

Callers 15

_sync_all_packagesFunction · 0.45
_check_systemctlFunction · 0.45
_git_versionFunction · 0.45
_check_systemctlFunction · 0.45
_default_pkg_mngrMethod · 0.45
__attrs_post_init__Method · 0.45
_install_pkgsMethod · 0.45
_install_ssm_serviceMethod · 0.45

Calls 2

dirFunction · 0.85
warningMethod · 0.80

Tested by 4

_sync_all_packagesFunction · 0.36
_check_systemctlFunction · 0.36
_git_versionFunction · 0.36
_check_systemctlFunction · 0.36