txtorcon icon indicating copy to clipboard operation
txtorcon copied to clipboard

Consider using py.test

Open meejah opened this issue 8 years ago • 6 comments

I believe the test-suite could be made more clear and shrink a little if using py.test. In any case, I prefer the py.test style and it saves an indent-level.

So, tests would look like:

def test_something(fixture0, fixture1):
    assert False, "It failed"

Anything in a setUp method would be converted to an @pytest.fixture and in some cases paramtrization could be used to good effect.

(This is al low-priority thing, but anyone interested in Twisted, py.test and Tor might like to tackle it).

meejah avatar Oct 09 '15 17:10 meejah

@meejah, any ongoing work on this? I'd like to take a stab at it. I saw #158 got closed off.

decentral1se avatar Nov 27 '16 12:11 decentral1se

Hi @lwm there hasn't been any more work on this, no. The tests in #158 are pretty basic ...

One thing that would be great to get out of a refactor to py.test would be to use Twisted's semi-official IOPump to do any of the tests that "fake out" network data from Tor. I haven't thought too hard about this, but ideally a @pytest.fixture would capture most of these use-cases somehow.

Beware that I've got a ton of refactoring, a few API changes and a couple new APIs (and basically a complete re-write of docs) in the release-1.x branch which I hope to make into master "soon".

meejah avatar Nov 27 '16 16:11 meejah

Beware that I've got a ton of refactoring

Ah, I reviewed the release-1.x diff and it's pretty big. I think I'll just wait for 1.x to arrive. I'll watch the repo and poke my head back when things are more stable. Kudos for the work.

decentral1se avatar Nov 27 '16 21:11 decentral1se

Yeah it's big :/

I will probably merge some of the "completely new" features into 0.x (since they don't change/break any APIs). I would appreciate feedback on the txtorcon.Tor object (in controller.py) -- specifically, whether you think this is an intuitive API.

meejah avatar Nov 27 '16 21:11 meejah

I would appreciate feedback on the txtorcon.Tor

I've had a look but I'm not really in a position to give any useful feedback. Sorry,

Good luck with the upcoming release!

decentral1se avatar Nov 27 '16 21:11 decentral1se

"Tor" etc have been merged to master

meejah avatar Apr 01 '18 07:04 meejah