[01:46:33] ** gpciceri has joined us [02:15:08] Maniac: time for a question ? [03:56:35] ** gpciceri has joined us [04:12:28] ** vlado_ has joined us [04:12:35] morning [04:30:05] jack-e|away is now known as jack-e [04:30:15] morning too :) [05:24:17] ** Maniac has joined us [06:47:15] ** vlado_ has joined us [07:30:31] ** gpciceri has joined us [09:44:39] ug, when using twisted.trial on some stuff i seem leaving some dangling callLater's somehow [09:44:49] just using unittest it runs fine... [10:10:42] ** gpciceri has joined us [10:45:53] rowr [10:46:35] i can't figure out how to use this damn thing [10:46:49] * Maniac pokes twisted.trial in the eye [11:27:14] ** vlado__ has joined us [11:36:19] oh now that's the shit ! [11:36:31] i had to set maxRetries on my ReconnectingClientFactory to 0 [11:37:27] yipee! [11:37:50] i stayed up till almost 2:00 am and only got 4 1/2 hrs of sleep for this shit! [11:38:20] what are you doing ? [11:38:24] your bot ? [11:41:19] jack-e is now known as jack-e|away [11:48:11] vlado__, well, yes, jabber stuff [11:48:30] but i was annoyed why i couldn't use twisted.trial [11:48:41] or why it was spitting FAIL at me... [11:49:10] when in doubt read the source i guess.... [14:10:05] ** hazmat has joined us [15:00:49] ** _jpl_ has joined us [15:02:29] <_jpl_> Hi #peak [15:09:26] hi _jpl_ [15:16:18] <_jpl_> It's been a good time for PEAK lately, it seems [15:17:18] good time? [15:18:06] thanks for the heads up on twisted.trial.... [15:18:14] once i got it working it's not bad [15:25:14] <_jpl_> Good time for documentation, interesting new things coming from pje, etc. [15:25:26] <_jpl_> Fresh new "faces" [15:26:37] <_jpl_> Yeah, trial is pretty handy. [15:27:07] <_jpl_> The main thing it provides which the built-in unittest.py doesn't is the command line test runner. [15:27:44] <_jpl_> Actually, the standard lib doesn't give you any command runner to speak of. [15:29:34] i really like trial -v -R mymodule [15:30:00] but i had issues earlier with 'dangling' reactors [15:30:06] which i eventually worked out [15:30:25] <_jpl_> Yes, the recursive test feature and coloring of results is really nice. [15:30:40] <_jpl_> Were you using trial.unittest.runReactor? [15:30:43] yes, "Hello World" has become a nice tutorial [15:30:48] no [15:31:54] <_jpl_> You were setting up your own reactors in the test code? [15:32:16] the component i was attempting to test obtains it's own reactor [15:32:55] and it uses a reconnectingClientFactory, which was the issue, because after the tests were done and the reactor tried to shut down it kept trying to reconnect [15:33:21] <_jpl_> Ah [15:34:11] i had to set maxRetries to 0 [15:34:59] testing asyncronous code is still a little icky [15:35:09] no nice linear flow, using callLaters etc. [15:38:14] <_jpl_> I'll soon be adding a feature to Junction which will allow for synchronous method calls. [15:38:32] <_jpl_> That won't help what you're doing, but it's something we need from time to time when using PB. [15:43:52] <_jpl_> Do you know about trial.util? [15:44:06] <_jpl_> Specifically its deferredResult/deferredError functions [16:00:34] no [16:00:38] * Maniac will look [16:07:24] <_jpl_> It's what they use for Twisted's own unit tests for synchronizing deferreds. [16:18:04] i'm not using deferred's [16:18:08] just callLater's [16:28:08] <_jpl_> In that case you probably want trial.unittest.runReactor [16:28:17] <_jpl_> er, unittest.TestCase.runReactor [16:28:48] <_jpl_> From within a test case method you can run self.runReactor() [16:30:03] hmm, [16:30:30] what i'm doing now, for example to test if the jabber client can connect is settting a connected flag on the client and running the reactor until True [16:30:40] self.timeout = self.client.reactor.callLater(2,self.failed,"timeout") [16:30:41] while self.client.connected: [16:30:41] self.client.reactor.iterate(0.1) [16:30:54] the 'client' has it's own reactor [16:31:45] ** vlado has joined us [16:32:52] <_jpl_> Right, you probably want self.runReactor for that. [16:33:19] <_jpl_> Something like: self.runReactor(self.timeout) [16:33:37] <_jpl_> wait... [16:34:32] * Maniac notes he's not very good at making test cases [16:35:29] <_jpl_> That 'while self.client.connected' will run while .connected is True; you were saying you were waiting *until* it turned True. [16:37:36] good point [16:39:21] bad test then eh ? [16:39:22] :) [16:47:41] heh, it actually tests something now that that is set correctly :) [16:48:45] one typically sets up 'dummy servers' to test client connections i'm just actually connecting with a test account [17:08:21] * vlado is away, somewhere far beyond... (l!on)(p!off) [cRk/bx] [18:25:46] ** vlado has joined us [19:24:01] ** vlado has joined us [20:18:23] ** hazmat has joined us [20:18:23] ** vlado__ has joined us [20:18:23] ** Maniac has joined us [20:18:23] ** jack-e|away has joined us [20:30:13] ** hazmat has joined us [20:30:13] ** vlado__ has joined us [20:30:13] ** Maniac has joined us [20:30:13] ** jack-e|away has joined us [22:03:11] ** hazmat has joined us [23:13:38] i need tests for my tests [23:33:16] ** _jpl_ has left us