Nir Soffer has posted comments on this change.

Change subject: profiling: move exceptions in a module
......................................................................


Patch Set 8:

(1 comment)

http://gerrit.ovirt.org/#/c/36013/8/tests/cpuProfileTests.py
File tests/cpuProfileTests.py:

Line 185:     def test_fail_if_Profile_is_running(self):
Line 186:         requires_yappi()
Line 187:         cpu.start()
Line 188:         try:
Line 189:             self.assertRaises(cpu.UsageError,
I don't think we should have cpu.UsageError as part of the interface of the cpu 
module. The whole idea of heaving an errors module is we can use these errors 
when handling errors from multiple types of profiles, because all of them raise 
errors defined in profiling.errors module.

Better use check that it raises profiling.errors.UsageError.

This code will break if we change cpu.py to:

    from . import errors
    ...
    raise errors.UsageError()
Line 190:                               self.profiled_function)
Line 191:         finally:
Line 192:             cpu.stop()
Line 193: 


-- 
To view, visit http://gerrit.ovirt.org/36013
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I1b12ea00b1613c028b0de2aeee9a9d3cc7a3b1e0
Gerrit-PatchSet: 8
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
Gerrit-Reviewer: Nir Soffer <[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

Reply via email to