*** regebro has quit IRC | 00:17 | |
*** tarek has quit IRC | 00:54 | |
*** MrTango has quit IRC | 01:00 | |
*** povbot` has joined #zope3-dev | 01:04 | |
*** jpcw has left #zope3-dev | 01:05 | |
*** sunew has quit IRC | 01:07 | |
*** r0ver has quit IRC | 01:08 | |
*** povbot has quit IRC | 01:08 | |
*** r0ver has joined #zope3-dev | 01:08 | |
*** fcorrea has quit IRC | 01:10 | |
*** dunny has quit IRC | 01:20 | |
*** r0ver has left #zope3-dev | 01:20 | |
*** redir has quit IRC | 01:21 | |
*** J1m has quit IRC | 01:28 | |
*** jan_s_ has quit IRC | 01:40 | |
*** r0ver has joined #zope3-dev | 01:51 | |
*** jhauser has quit IRC | 02:04 | |
*** Azriphale has quit IRC | 02:14 | |
*** romanofski has joined #zope3-dev | 02:23 | |
*** r0ver has left #zope3-dev | 02:39 | |
*** srichter has joined #zope3-dev | 02:41 | |
*** ChanServ sets mode: +o srichter | 02:41 | |
*** mcdonc has quit IRC | 02:45 | |
*** mcdonc has joined #zope3-dev | 02:45 | |
*** mcdonc_ has joined #zope3-dev | 03:10 | |
*** mcdonc has quit IRC | 03:10 | |
*** mcdonc_ has quit IRC | 03:16 | |
*** grahal has quit IRC | 03:39 | |
*** fcorrea has joined #zope3-dev | 03:45 | |
*** fcorrea_ has joined #zope3-dev | 03:45 | |
*** fcorrea has quit IRC | 03:45 | |
*** fcorrea_ is now known as fcorrea | 03:45 | |
*** allisterb has quit IRC | 03:47 | |
*** allisterb has joined #zope3-dev | 03:52 | |
*** mcdonc_ has joined #zope3-dev | 04:15 | |
*** stub has joined #zope3-dev | 04:21 | |
*** aaronv has quit IRC | 05:09 | |
*** baijum has joined #zope3-dev | 05:36 | |
*** davisagli is now known as davisagli|away | 06:13 | |
*** kursor has joined #zope3-dev | 06:20 | |
*** baijum has quit IRC | 06:28 | |
*** kursor has quit IRC | 06:54 | |
*** huajie has joined #zope3-dev | 06:58 | |
*** alecm has quit IRC | 07:09 | |
*** afd_ has joined #zope3-dev | 07:18 | |
*** davisagli|away is now known as davisagli | 07:41 | |
*** baijum has joined #zope3-dev | 07:54 | |
*** jukart has joined #zope3-dev | 08:00 | |
*** jukart has quit IRC | 08:12 | |
*** davisagli is now known as davisagli|away | 08:14 | |
*** alga_ has quit IRC | 08:16 | |
*** alga has quit IRC | 08:16 | |
*** timte has joined #zope3-dev | 08:17 | |
*** jukart has joined #zope3-dev | 08:39 | |
*** yotaff has joined #zope3-dev | 08:45 | |
*** astoon has joined #zope3-dev | 08:52 | |
*** stub has quit IRC | 09:04 | |
*** alga has joined #zope3-dev | 09:13 | |
*** alga_ has joined #zope3-dev | 09:13 | |
*** sweh has joined #zope3-dev | 09:24 | |
*** MrTango has joined #zope3-dev | 09:29 | |
*** redir has joined #zope3-dev | 09:29 | |
*** astoon has quit IRC | 09:51 | |
*** Theuni1 has quit IRC | 10:05 | |
*** wosc has joined #zope3-dev | 10:06 | |
*** wosc has quit IRC | 10:09 | |
*** wosc has joined #zope3-dev | 10:11 | |
*** wosc_ has joined #zope3-dev | 10:14 | |
*** wosc has quit IRC | 10:14 | |
*** wosc has joined #zope3-dev | 10:14 | |
*** wosc has quit IRC | 10:28 | |
*** goschtl has joined #zope3-dev | 10:38 | |
*** romanofski has quit IRC | 10:39 | |
*** tarek has joined #zope3-dev | 10:39 | |
*** regebro has joined #zope3-dev | 10:41 | |
*** afd_ has quit IRC | 10:45 | |
*** astoon has joined #zope3-dev | 11:01 | |
*** zagy has joined #zope3-dev | 11:02 | |
*** andreypopp has joined #zope3-dev | 11:03 | |
*** jhauser has joined #zope3-dev | 11:05 | |
*** MJ has joined #zope3-dev | 11:12 | |
*** stub has joined #zope3-dev | 11:12 | |
*** stub has joined #zope3-dev | 11:12 | |
*** srichter has quit IRC | 11:14 | |
*** afd_ has joined #zope3-dev | 11:21 | |
*** Theuni1 has joined #zope3-dev | 11:27 | |
*** ccomb has joined #zope3-dev | 11:33 | |
*** astoon has quit IRC | 11:45 | |
*** romanofski has joined #zope3-dev | 11:50 | |
*** astoon has joined #zope3-dev | 12:14 | |
*** kiorky has quit IRC | 12:44 | |
*** kiorky has joined #zope3-dev | 12:45 | |
*** kiorky has quit IRC | 12:49 | |
*** kiorky has joined #zope3-dev | 12:50 | |
*** ignas has joined #zope3-dev | 12:51 | |
*** stub has quit IRC | 13:20 | |
*** astoon has quit IRC | 13:21 | |
*** Azriphale has joined #zope3-dev | 13:31 | |
*** benji has quit IRC | 13:48 | |
*** projekt01 has joined #zope3-dev | 13:56 | |
*** baijum has quit IRC | 14:02 | |
*** projekt01 has quit IRC | 14:03 | |
*** baijum has joined #zope3-dev | 14:05 | |
*** projekt01 has joined #zope3-dev | 14:07 | |
*** baijum has quit IRC | 14:17 | |
*** baijum has joined #zope3-dev | 14:18 | |
*** astoon has joined #zope3-dev | 14:27 | |
*** astoon has quit IRC | 14:37 | |
*** menesis has quit IRC | 14:38 | |
*** mgedmin has joined #zope3-dev | 14:42 | |
*** pyqwer has joined #zope3-dev | 14:48 | |
*** aaronv has joined #zope3-dev | 14:51 | |
*** jpcw has joined #zope3-dev | 15:00 | |
*** yotaff has quit IRC | 15:04 | |
*** benji has joined #zope3-dev | 15:15 | |
*** lamike has joined #zope3-dev | 15:17 | |
*** lamike has left #zope3-dev | 15:17 | |
*** kiorky has quit IRC | 15:18 | |
*** kiorky has joined #zope3-dev | 15:18 | |
*** menesis has joined #zope3-dev | 15:28 | |
*** fcorrea has quit IRC | 15:38 | |
*** fcorrea has joined #zope3-dev | 15:43 | |
*** fcorrea has quit IRC | 15:55 | |
*** J1m has joined #zope3-dev | 15:57 | |
*** romanofski has quit IRC | 16:00 | |
*** sweh has quit IRC | 16:02 | |
*** allisterb has quit IRC | 16:21 | |
*** fcorrea has joined #zope3-dev | 16:26 | |
*** sunew has joined #zope3-dev | 16:34 | |
*** allisterb has joined #zope3-dev | 16:35 | |
*** Theuni1 has quit IRC | 16:39 | |
*** huajie has quit IRC | 16:48 | |
*** aaronv has quit IRC | 16:50 | |
*** allisterb has quit IRC | 16:52 | |
*** timte_ has joined #zope3-dev | 16:57 | |
*** timte has quit IRC | 16:57 | |
*** timte_ is now known as timte | 16:57 | |
*** alga_ has quit IRC | 16:59 | |
*** alga has quit IRC | 17:01 | |
*** allisterb has joined #zope3-dev | 17:05 | |
*** baijum has quit IRC | 17:06 | |
*** huajie has joined #zope3-dev | 17:07 | |
*** kursor has joined #zope3-dev | 17:10 | |
*** andreypopp has quit IRC | 17:20 | |
*** andreypopp has joined #zope3-dev | 17:20 | |
*** astoon has joined #zope3-dev | 17:27 | |
*** goschtl has quit IRC | 17:29 | |
*** projekt01 has quit IRC | 17:29 | |
*** ignas has quit IRC | 17:30 | |
*** jfkw has joined #zope3-dev | 17:31 | |
*** andreypopp has quit IRC | 17:34 | |
*** timte has quit IRC | 17:36 | |
*** allisterb has quit IRC | 17:48 | |
*** huajie has quit IRC | 17:48 | |
*** jukart has quit IRC | 17:57 | |
*** sweh has joined #zope3-dev | 18:00 | |
*** allisterb has joined #zope3-dev | 18:04 | |
*** baijum has joined #zope3-dev | 18:04 | |
*** davisagli|away is now known as davisagli | 18:04 | |
*** davisagli is now known as davisagli|away | 18:10 | |
*** gary_poster is now known as gary-lunch | 18:13 | |
*** r0ver has joined #zope3-dev | 18:20 | |
*** ignas has joined #zope3-dev | 18:21 | |
*** J1m has quit IRC | 18:22 | |
*** J1m has joined #zope3-dev | 18:23 | |
*** r0ver has left #zope3-dev | 18:25 | |
*** zagy has quit IRC | 18:28 | |
*** davisagli|away is now known as davisagli | 18:29 | |
*** mcdonc_ has quit IRC | 18:29 | |
*** andreypopp has joined #zope3-dev | 18:36 | |
*** mcdonc has joined #zope3-dev | 18:39 | |
*** ccomb has quit IRC | 18:50 | |
*** MJ has quit IRC | 19:01 | |
*** jhauser has quit IRC | 19:04 | |
*** gary-lunch is now known as gary_poster | 19:26 | |
*** menesis has quit IRC | 19:47 | |
*** andreypopp has quit IRC | 19:50 | |
*** chrisw1 has joined #zope3-dev | 19:50 | |
*** Azriphale has quit IRC | 19:50 | |
chrisw1 | what's the best way to test code that registers a utility? | 19:50 |
---|---|---|
chrisw1 | where can I find good examples? | 19:50 |
*** Azriphale has joined #zope3-dev | 19:52 | |
*** sunew has quit IRC | 19:54 | |
*** andreypopp has joined #zope3-dev | 19:57 | |
*** jukart has joined #zope3-dev | 20:00 | |
*** alecm has joined #zope3-dev | 20:00 | |
astoon | chrisw1: do you mean registration in zcml ? | 20:00 |
*** andreypopp has quit IRC | 20:02 | |
chrisw1 | astoon: nope, I mean I want to test that my call to registerUtility has done what its supposed to | 20:04 |
chrisw1 | I guess I'm worried about making sure the registry was as I left it | 20:05 |
astoon | chrisw1: do not worry | 20:06 |
chrisw1 | er? | 20:06 |
mgedmin | chrisw1, if you use zope.app.testing.setup, call setup.placelessSetUp() in your test setUp(), and placelessTearDown() in your test tearDown() | 20:08 |
mgedmin | that'll ensure you get a fresh clean empty component registry for every test | 20:08 |
*** regebro has quit IRC | 20:08 | |
mgedmin | or you could unregister your utility manually in the tearDown | 20:08 |
chrisw1 | I'm just using zope.component | 20:08 |
mgedmin | the unittest2 "addCleanUp" API would be great for this | 20:08 |
chrisw1 | I want to keep these tests as lightweight as possible | 20:08 |
mgedmin | incidentally, I was once bitten very hard by unregisterAdapter/Utility | 20:08 |
chrisw1 | what would i add as a cleanup though? | 20:09 |
mgedmin | let me think for a moment | 20:09 |
chrisw1 | http://svn.zope.org/zope.component/tags/3.9.4/src/zope/component/testing.py?rev=111710&view=auto is rather confiusing | 20:10 |
chrisw1 | where are the cleanups for the registry added? | 20:10 |
mgedmin | somewhere in zope.component | 20:11 |
mgedmin | there's a module-level call to addCleanUp() (unrelated to the unittest2 addClenup() API, BTW) | 20:11 |
mgedmin | that registers a cleanup function | 20:11 |
mgedmin | all of those get invoked when you do placelessSetUp/tearDown | 20:11 |
mgedmin | you gotta love import-time side effects if you work on zope3 | 20:11 |
mgedmin | s/on/with/ | 20:12 |
mgedmin | I would use placelessSetUp/tearDown for a unit test of a function that's supposed to invoke registerUtility | 20:12 |
mgedmin | simplest way | 20:12 |
mgedmin | maybe not the most efficient one | 20:12 |
mgedmin | runtime-wise | 20:12 |
mgedmin | it _is_ the most efficient one, developer-time-wise | 20:13 |
mgedmin | unless you want to use layers with shared ZCML setup | 20:13 |
* chrisw1 is not working on zope3, I just want to use zope.component :-( | 20:13 | |
mgedmin | but that's why I said "unit test", which implies "no layers" | 20:13 |
chrisw1 | right | 20:13 |
mgedmin | sure, zope.component.test.setUp/tearDown should do the trick | 20:13 |
chrisw1 | I want to find the cleanup registration | 20:13 |
mgedmin | if unsure, compare list(getGlobalSiteManager().registrations()) before and after your test | 20:14 |
chrisw1 | any idea where it is? | 20:14 |
* mgedmin hates ViewCVS | 20:14 | |
chrisw1 | ditto | 20:14 |
chrisw1 | but hey, don't you have a trac mirror?! | 20:14 |
mgedmin | http://zope3.pov.lt/trac/browser/zope.component/tags/3.9.4/src/zope/component | 20:15 |
mgedmin | it doesn't let me grep... | 20:15 |
mgedmin | here: http://zope3.pov.lt/trac/browser/zope.component/tags/3.9.4/src/zope/component/globalregistry.py#L53 | 20:15 |
chrisw1 | thankfully I keep all my eggs unzipped | 20:15 |
chrisw1 | and grep does let me grep ;-) | 20:16 |
mgedmin | this is the import-time code that registers a cleanup handler | 20:16 |
chrisw1 | why the fuck do we still do that? | 20:16 |
chrisw1 | :-( | 20:16 |
mgedmin | that is then invoked by http://zope3.pov.lt/trac/browser/zope.component/tags/3.9.4/src/zope/component/testing.py | 20:16 |
chrisw1 | and explicty registration of a cleanup would be the way to go... | 20:16 |
* mgedmin shrugs | 20:16 | |
chrisw1 | I think I'll just use testfixtures' replace functionality to insert a new BaseGlobalComponents for each test | 20:17 |
chrisw1 | ...and keep the old one safe! | 20:17 |
mgedmin | that might work, maybe | 20:19 |
*** mgedmin has quit IRC | 20:19 | |
chrisw1 | why would it not? | 20:20 |
*** astoon has quit IRC | 20:23 | |
*** regebro has joined #zope3-dev | 20:32 | |
*** redir has quit IRC | 20:33 | |
*** ignas has quit IRC | 20:39 | |
*** Azriphale has quit IRC | 20:41 | |
*** Azriphale has joined #zope3-dev | 20:43 | |
*** kursor has quit IRC | 20:48 | |
*** jukart has quit IRC | 21:08 | |
*** jpcw has left #zope3-dev | 21:43 | |
*** mcdonc has quit IRC | 21:43 | |
*** mcdonc has joined #zope3-dev | 21:44 | |
*** afd_ has quit IRC | 22:00 | |
*** redir has joined #zope3-dev | 22:03 | |
*** baijum has quit IRC | 22:59 | |
*** r0ver has joined #zope3-dev | 23:01 | |
*** allisterb has quit IRC | 23:25 | |
*** pyqwer has quit IRC | 23:36 | |
*** allisterb has joined #zope3-dev | 23:38 | |
*** r0ver has left #zope3-dev | 23:45 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!