Ondřej Svoboda has posted comments on this change. Change subject: net_func_tests: add calling method name to setupNetworks ......................................................................
Patch Set 3: Verified+1 Code-Review+1 (1 comment) A great help when running tests. In this form it works well but I have followed Toni and hinted how to enhance readability (by obtaining a named tuple). http://gerrit.ovirt.org/#/c/35711/3/tests/functional/utils.py File tests/functional/utils.py: Line 153: Line 154: @netinfo_altering Line 155: def setupNetworks(self, networks, bonds, options): Line 156: stack = inspect.stack() Line 157: options['_caller'] = stack[2][3] # add calling method for logs This can further be amended with getframeinfo to get a named tuple (from the first member of the original frame record/tuple, which is the populated frame object). And also split to a sub-function. calling_method = inspect.getframeinfo(stack[2][0]) options['_caller'] = calling_method.function … and also, as Toni noted, by searching the stack for the actual test method. Line 158: result = self.vdscli.setupNetworks(networks, bonds, options) Line 159: return result['status']['code'], result['status']['message'] Line 160: Line 161: def _vlanInRunningConfig(self, devName, vlanId): -- To view, visit http://gerrit.ovirt.org/35711 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id5f07be1f2cef54a773deb8dd73967dc55bf2cf0 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Antoni Segura Puimedon <[email protected]> Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Ido Barkan <[email protected]> Gerrit-Reviewer: Ondřej Svoboda <[email protected]> Gerrit-Reviewer: Petr Horáček <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
