#jython IRC Log

Index

IRC Log for 2014-08-26

Timestamps are in GMT/BST.

[0:15] * mike_af (~mike_af@unaffiliated/mike-af/x-5454762) Quit (Remote host closed the connection)
[0:19] * mike_af_ (~mike_af@c-66-41-226-143.hsd1.mn.comcast.net) has joined #jython
[0:59] * lheuer (~Adium@unaffiliated/lheuer) Quit (Ping timeout: 250 seconds)
[1:32] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[2:31] * mike_af_ (~mike_af@c-66-41-226-143.hsd1.mn.comcast.net) Quit (Remote host closed the connection)
[2:32] * mike_af (~mike_af@unaffiliated/mike-af/x-5454762) has joined #jython
[2:36] * mike_af (~mike_af@unaffiliated/mike-af/x-5454762) Quit (Ping timeout: 240 seconds)
[5:09] * Arfrever (~Arfrever@apache/committer/Arfrever) has joined #jython
[6:31] * jimbaker (~jbaker@24.9.252.60) Quit (Ping timeout: 245 seconds)
[6:35] * jimbaker (~jbaker@24.9.252.60) has joined #jython
[6:36] * jimbaker (~jbaker@24.9.252.60) Quit (Changing host)
[6:36] * jimbaker (~jbaker@python/psf/jimbaker) has joined #jython
[7:28] * lheuer (~Adium@unaffiliated/lheuer) has joined #jython
[7:34] * Arfrever (~Arfrever@apache/committer/Arfrever) Quit (Ping timeout: 260 seconds)
[8:37] * Arfrever (~Arfrever@apache/committer/Arfrever) has joined #jython
[9:04] * lheuer (~Adium@unaffiliated/lheuer) Quit (Read error: Connection reset by peer)
[9:44] * lheuer (~Adium@unaffiliated/lheuer) has joined #jython
[11:27] <topi`> jython is such an excellent tool for shell guys like me developing java
[11:27] <topi`> as opposed to these new school Eclipse-wielding guys who are accustomed (and do not complain about) graphical IDE's
[11:28] * agronholm is accustomed to Eclipse, and complains about it
[11:28] <topi`> I wrote a somewhat nontrivial way of loading and parsing binary data from Properties files, and the only feasible way I could think of testing/checking that the data was what I expected (when decoded by the java code) was to replicate that in a jython script
[11:28] <agronholm> as opposed to a JUnit test?
[11:28] <topi`> all I had to do was to copypaste the imports from java code over to my jython script
[11:29] <topi`> and then slightly rewrite the portions of java code, like
[11:29] <topi`> props = java.util.Properties() instead of new java.util.Properties
[11:29] <topi`> and I can use normal python stdlib funcs like hashlib.sha256 to check that the binary data was correct after decoding.
[11:30] <topi`> agronholm: I lack the skills and motivation and time to learn JUnit testing
[11:30] <topi`> my java knowledge is very shallow
[11:30] <topi`> and even for a simple module, I need to do probably 10-100 stackoverflow searches...
[11:45] * lheuer (~Adium@unaffiliated/lheuer) Quit (Read error: Connection reset by peer)
[12:01] * xemdetia (xemdetia@nat/ibm/x-qjnarchcrnfxwknk) has joined #jython
[13:04] * gthank (~gthank@unaffiliated/gthank) has joined #jython
[13:28] <peke> topi`: do you know Python unittest? if yes, learning junit is trivial. the former was originally a port of the latter.
[13:29] <peke> it might still be a good idea to test that java code using unittest on jython instead of junit on java....
[13:29] <peke> or nose/py.test even, assuming they work on jython (haven't checked)
[13:30] <agronholm> they do
[13:30] <peke> agronholm: cool! also in 2.5 or only in 2.7?
[13:30] <agronholm> I recall running nose on 2.5
[13:31] <peke> ok, i should check some day. the boilerplate required by unittest is very un-pythonic.
[13:32] <agronholm> py.test is hands down the best test framework I've seen
[13:32] <agronholm> nose is pretty much dead in the water, don't use that
[13:58] <topi`> so py.test would be a better choice than unittest?
[13:58] <topi`> I've mainly used unittest, and its async sibling, twisted trial
[13:59] * mike_af (~mike_af@unaffiliated/mike-af/x-5454762) has joined #jython
[14:12] <peke> topi`: i think the main benefit of nose was better test discovery, but that was improved in unittest in py 2.7
[14:13] <peke> py.test is great because it requires so little boilerplate. basically you can just use `assert`, but py.test modifies bytecode so that you still get meaningful error messages.
[14:13] <peke> both py.test and nose are compatible with unittest.
[14:14] <peke> btw, just yesterday i created this demo project based on some old examples i had in my soon-to-be-re-installed machine:
[14:14] <peke> https://github.com/pekkaklarck/python-unit-test-tool-comparison
[14:15] <agronholm> this merely scratches the surface
[14:15] <peke> very simple comparison but shows how little boilerplate nose and py.test require compared to unittest, and that with py.test you still get good errors.
[14:16] <peke> agronholm: i know. i just had those examples on my machine and wanted to put them somewhere before i wipe it.
[14:17] <agronholm> two very notable points are missing: 1) that nose has been out of maintenance for many years now, and 2) pytest's fixtures are awesome
[14:17] <agronholm> oh hm
[14:17] <agronholm> scratch the first, it seems nose received an update two days ago
[14:17] <peke> agronholm: fair enough. pull-requests are accepted. =)
[14:18] <peke> agronholm: or, if you are interested to create a better comparison, just fork the one i did and edit as you want.
[14:18] <agronholm> I'm not.
[14:20] <agronholm> I was mistaken about nose being out of maintenance
[14:20] <agronholm> but it's pointless because it doesn't provide anything py.test doesn't already do a lot better
[15:16] <topi`> fixtures? something similar to django fixtures? :)
[15:16] <topi`> i'm really out of tune with nowadays technical jargon...
[15:17] <xemdetia> topi`, I am pretty sure it's an overloaded term
[15:28] <peke> topi`: fixture in (unit) testing terminology basically means setup/teardown. traditionally xunit frameworks such as unittest supported setUp and tearDown methods in classes that contained tests, and those methods were executed before/after each test method.
[15:29] <peke> i've understood, but never studied in detail, that py.test has also other mechanisns to create fixtures. perhaps agronholm can give a short summary. or we just consider this offtopic and go to http://pytest.org ourselves....
[15:54] * enebo (~enebo@c-75-73-8-169.hsd1.mn.comcast.net) has joined #jython
[17:21] <agronholm> py.test takes fixtures to the next level
[17:21] <agronholm> you can have session, module, class and function level fixtures
[17:22] <agronholm> which can depend on each other
[17:22] <agronholm> (obviously higher level fixtures can't depend on lower level ones)
[17:24] * jimbaker (~jbaker@python/psf/jimbaker) Quit (Ping timeout: 245 seconds)
[17:24] * jimbaker (~jbaker@24.9.252.60) has joined #jython
[17:25] * jimbaker (~jbaker@24.9.252.60) Quit (Changing host)
[17:25] * jimbaker (~jbaker@python/psf/jimbaker) has joined #jython
[17:38] * fwierzbicki (~Adium@99-106-169-5.lightspeed.sntcca.sbcglobal.net) has joined #jython
[17:38] * fwierzbicki1 (~Adium@99-106-169-5.lightspeed.sntcca.sbcglobal.net) Quit (Read error: Connection reset by peer)
[17:45] <jimbaker> nose or py.test, both work fine on jython
[17:46] <jimbaker> peke, although the bytecode modification would not work :) - i don't know enough about py.test, i just have run test suites using it
[17:57] <agronholm> peke: does it really modify bytecode?
[18:13] <peke> agronholm: not actually sure does py.test modify bytecode or what, but something magic it does to make `assert result == 42` to produce a nice error showing only the value of `result`. //cc jimbaker
[18:14] <peke> oops, "showing _also_ the value of `result`"...
[18:14] <agronholm> peke: I'm thinking it's inspecting the stack frames individually
[18:17] <peke> details about handling assert are here: http://pytest.org/latest/assert.html#assert-details
[18:18] <peke> """pytest rewrites test modules on import. It does this by using an import hook to write a new pyc files."""
[18:19] <peke> """If an assert statement has not been rewritten or the Python version is less than 2.6, pytest falls back on assert reinterpretation. In assert reinterpretation, pytest walks the frame of the function containing the assert statement to discover sub-expression results of the failing assert statement."""
[18:19] <agronholm> that's what I figured
[18:20] <agronholm> I didn't know about test module rewriting though
[18:20] <peke> rewriting apparently doesn't work at least with jython 2.5.
[19:38] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Excess Flood)
[19:39] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[19:41] * enebo (~enebo@c-75-73-8-169.hsd1.mn.comcast.net) Quit (Quit: enebo)
[19:44] <jimbaker> peke, yeah, it's not going to work with jython as described
[19:44] <jimbaker> good there's a fallback
[20:08] * enebo (~enebo@63.231.242.9) has joined #jython
[20:09] <peke> yes, py.test is pretty clever in this regard. big up for holger!
[20:30] * xemdetia_ (xemdetia@nat/ibm/x-taleftkaxhgqaugw) has joined #jython
[20:33] * xemdetia (xemdetia@nat/ibm/x-qjnarchcrnfxwknk) Quit (Ping timeout: 260 seconds)
[20:34] * xemdetia_ (xemdetia@nat/ibm/x-taleftkaxhgqaugw) Quit (Ping timeout: 250 seconds)
[20:40] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Ping timeout: 250 seconds)
[20:40] * gthank (~gthank@unaffiliated/gthank) Quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz???)
[21:10] * Arfrever (~Arfrever@apache/committer/Arfrever) Quit (Ping timeout: 260 seconds)
[21:21] * enebo (~enebo@63.231.242.9) Quit (Quit: enebo)
[21:22] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[21:26] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Client Quit)
[21:56] * srcerer (~chatzilla@dns2.klsairexpress.com) has joined #jython
[22:15] * mike_af (~mike_af@unaffiliated/mike-af/x-5454762) Quit (Remote host closed the connection)
[22:21] * fwierzbicki1 (~Adium@99-106-169-5.lightspeed.sntcca.sbcglobal.net) has joined #jython
[22:23] * [Arfreve1] (~Arfrever@minotaur.apache.org) has joined #jython
[22:24] * fwierzbicki (~Adium@99-106-169-5.lightspeed.sntcca.sbcglobal.net) Quit (Ping timeout: 255 seconds)
[22:24] * mary_ (~ircfnode@moya.miuark.net) Quit (Ping timeout: 255 seconds)
[22:24] * mary (~ircfnode@moya.miuark.net) has joined #jython
[22:24] * mary is now known as Guest50468
[22:25] * mbooth_ (~mbooth@cpc68386-shef10-2-0-cust10.17-1.cable.virginm.net) has joined #jython
[22:35] * fwierzbicki (~Adium@99-106-169-5.lightspeed.sntcca.sbcglobal.net) has joined #jython
[22:35] * [Arfreve2] (~Arfrever@minotaur.apache.org) has joined #jython
[22:38] * mbooth (~mbooth@cpc68386-shef10-2-0-cust10.17-1.cable.virginm.net) Quit (*.net *.split)
[22:38] * [Arfrever] (~Arfrever@apache/committer/Arfrever) Quit (*.net *.split)
[22:42] * [Arfreve1] (~Arfrever@minotaur.apache.org) Quit (*.net *.split)
[22:42] * fwierzbicki1 (~Adium@99-106-169-5.lightspeed.sntcca.sbcglobal.net) Quit (*.net *.split)
[22:42] * mhahe (~mhahe@95.85.22.247) Quit (*.net *.split)
[22:44] * mhahe (~mhahe@95.85.22.247) has joined #jython
[22:49] * whg (whg@unaffiliated/whg) Quit (Changing host)
[22:49] * whg (whg@nat/ibm/x-uyemwhbdyeqryzza) has joined #jython
[23:46] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython

Index

These logs were automatically created by JythonLogBot on irc.freenode.net using a slightly modified version of the Java IRC LogBot.