For me, the built-in "unittest" library is good enough. There is a unittest.skipIf decorator to put around tests that should only run if you have certain dependencies.
Le jeudi 17 juillet 2014 16:28:52 UTC+2, Ron Frederick a écrit : > > Hi Jonathan, > > I have done quite a bit of manual testing of the code and I have written > my own automated test script which thoroughly exercises all of the key > import/export code trying all combinations of key types and formats at > various key sizes (over 700 different variations). However, I haven't > checked this test code in yet as I'd like to learn one of the Python unit > test frameworks and rewrite my tests in that so that I can properly > integrate them into setup.py. > > Suggestions for a good test framework to use here would be welcome. I'm > tempted to stick with something from the Python standard library to > minimize external dependencies. Is unittest (and unittest.mock now in > Python 3.3+) a good option these days? > > One other challenge is that I wanted my key import/export tests to test > interoperability with other tools like openssl and ssh-keygen. However, > that meant the script had dependencies on those external tools being > installed on the system. That's no problem when I run the tests here, but > I'll probably need to find a way to conditionalize these tests for running > on systems without the tools installed. This may also hurt the portability > of the code. Again, any suggestions or pointers to examples of good ways to > deal with this would be appreciated! > > On Thursday, July 17, 2014 6:16:14 AM UTC-7, Jonathan Slenders wrote: >> >> Thanks you Ron, >> >> That was already on my wish list for a while. twisted.conch is old and >> doesn't run on Python3 and Paramiko has a threaded model. >> But writing an SSH library takes a lot of effort to get it right. >> >> I leave on holiday tomorrow, so I don't have time to try it out. >> >> But do you actually have unit tests? >> >> >> Cheers, >> Jonathan >> >
