On Friday, November 1, 2019 at 10:43:35 AM UTC-5, Edward K. Ream wrote: > The next step will be to devise an easy way of running python's relevant unit tests, in test_tokenize.py, on the new code.
The normal Anaconda distro doesn't include much in the lib/test folder, so I downloaded them from here <https://github.com/python/cpython/tree/3.6/Lib/test>. I created a file, test_ekr_untokenize.py that included only untokenizer tests from test_tokenizer.py. I then added a test that should fail. Imagine my surprise when it didn't. Here's why: def check_roundtrip(self, f): """ Test roundtrip for `untokenize`. `f` is an open file or a string. The source code in f is tokenized to both 5- and 2-tuples. Both sequences are converted back to source code via tokenize.untokenize(), and the latter tokenized again to 2-tuples. The test fails if the 3 pair tokenizations do not match. When untokenize bugs are fixed, untokenize with 5-tuples should reproduce code that does not contain a backslash continuation following spaces. A proper test should test this. """ Well, this is just dandy. What is the point of unit tests if they are fudged? I'll have to think on this... Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/02ab40fd-2295-483e-b6cb-01f910b5e821%40googlegroups.com.
