IRC Logs for #circuits Saturday, 2013-11-16

*** koobs has quit IRC04:31
*** koobs has joined #circuits04:31
*** Aeoxic has joined #circuits08:44
Aeoxic?_?08:44
Aeoxicprologic: Your code doesn't work here. ;_;08:45
AeoxicPrimarily because you don't have to write in before you quit. :\08:45
prologichey08:55
prologiceh?08:55
prologicthe code works prefectly08:55
prologicwhat's wrong with it?08:55
AeoxicSimilar issues as previously.08:57
AeoxicIt wasn't actually exiting anything.08:57
prologicok09:04
prologicwell it works for me09:04
prologicI run the server09:05
prologicit fires up a process runnning ping09:05
prologicI connect a unix client to it09:05
prologicand type: stop<ENTER>09:05
prologicand the process termiantes09:05
prologicas well as the server09:05
prologicisn't that what you wanted to achieve?09:05
Aeoxicself.fire(Event.create("stop"), self.spectre)09:13
AeoxicThat'll just call the _on_stop function, right?09:13
prologicyes09:16
prologicwhich in turn stops the process09:16
spaceoneprologic: you use pytest for your tests?09:33
prologicyes09:33
prologicI use it for all my peojcts09:33
spaceonewhy? and why not unittest, etc.?09:34
prologicbecause I find pytest much simpler to use09:35
prologicand far more flexible and powerful09:35
prologicwriting tests should be easy09:35
prologicwith as little boiler plaet as possible09:35
prologicthat's why I like pytest09:35
prologicdef test_foo():09:35
prologic   assert "foo" == "foo"09:35
prologicdone09:35
prologictrivial, but makes the point09:35
prologiccircuits did use unittest once upon a time09:35
prologicbut once we switced to pytest09:35
prologicsuddenly we had hundreds of unit tests09:36
prologicand >80% coverage09:36
prologicalso pytest is highly pluggable09:36
prologicintegrate with tox so you can run tests against multiple envionment09:36
prologiceven distributed09:36
prologicetc etc09:36
prologicI could go on09:36
prologicgo ask #py and hpk why pytest is so great09:36
prologiche's the author :)09:36
prologicalso #pypy uses it extensively09:36
prologicso it must be good :)09:36
prologicalso see examples/testing09:37
prologicfor how to do TDD with circuits and pytest09:37
spaceoneokay09:45
spaceonethanks09:45
prologic:)09:49
spaceonepytest.fixture creates a singleton, right?10:03
prologicumm10:11
prologicsingleton is probably the wrong term here10:11
prologicpytest.fixture is a deactor10:15
prologicwell a decroated wrapper10:15
prologicthat creates anything you want10:15
prologic@fixture10:15
prologicdef foo(request):10:15
prologic   return "foo"10:15
prologicdef test_foo(foo):10:15
prologic   assert foo == "foo"10:15
prologicis the simplest example of this10:16
prologicit is the equivilent of unittest setup/teardown10:16
prologicbut with normal functions10:16
prologicthere is also10:16
prologicrequest.addfinalizer(func)10:16
*** ircnotifier has quit IRC10:41
*** ircnotifier has joined #circuits11:22
*** Aeoxic has quit IRC14:15

Generated by irclog2html.py 2.11.0 by Marius Gedminas - find it at mg.pov.lt!