Test formatting standard

Mark Atwood fallenpegasus at gmail.com
Thu May 18 21:24:38 UTC 2017


That sounds useful and productive.   Unless GEM, ESR, or Hal have any
objection, feel free to go through the other existing tests and clean them
up the same way.

Thanks!

..m


On Wed, May 17, 2017 at 6:34 PM Ian Bruene via devel <devel at ntpsec.org>
wrote:

> Currently the tests follow a general format of a comment line describing
> what a particular test is attempting to test, followed by the test. I
> propose that the first line of each test_* function be the assignment of
> a shorter name for the function being tested. For examples see a number
> of the tests in test_util.py.
>
> Reasoning:
> It greatly reduces the number of unnecessary characters typed.
> It eliminates the potential of typos in the function name when making
> new tests, which due to the sheer length are more annoying to track down
> than they should be.
> It is added semantic information; clearly establishing the correct
> function in a similar way to a docstring.
> The cost of doing it this way is negligible: one very simple line of
> source, and one assignment.
>
> I've already been doing this with the tests I write, and it looks
> cleaner than the alternative. Again, see test_util.py for examples.
>
> --
> In the end; what separates a Man, from a Slave? Money? Power?
> No. A Man Chooses, a Slave Obeys. -- Andrew Ryan
>
> _______________________________________________
> devel mailing list
> devel at ntpsec.org
> http://lists.ntpsec.org/mailman/listinfo/devel
>
-- 

Mark Atwood
http://about.me/markatwood
+1-206-604-2198 SMS & Signal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20170518/adc678e2/attachment.html>


More information about the devel mailing list