Can't get unittest to run
-
I installed this library which includes a test of unittest itself.
However, when I import test_unittest it does nothing. If I edit line 114 of test_unittest.py as per the below I get "Ran 0 tests"
So... how the heck do I use unittest on the WiPy?
Line 114 before:
if __name__ == '__main__': unittest.main() >>> import test_unittest >>>Edited:
#if __name__ == '__main__': unittest.main() >>> import test_unittest Ran 0 tests >>>Plain vanilla assert works on the WiPy.
>>> assert 1 == 1, 'Not equal' >>> assert 1 == 2, 'Not equal' Traceback (most recent call last): File "<stdin>", line 1, in <module> AssertionError: Not equal >>>Same test using Cygwin Python 3.6 on my Windows laptop:
$ python3 test_unittest.py ...........s... ---------------------------------------------------------------------- Ran 15 tests in 0.031s OK (skipped=1) $ -
This post is deleted!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login