Should I test the debug branch of my code in a unit test?

by Hakaishin   Last Updated June 20, 2018 10:05 AM

Lets say I have a function that gets a list of what files to send that are later send over a socket to some other pc. Now usually I keep track of what files have been sent and don't send these files again for easier coding and debugging I have this:

if debug:
   files_to_send = os.listdir()
   files_to_send.remove(files_sent_log)

otherwise I would have to delete the log every time I want to rerun the program.

Now my question is should I test this? My intuition is no, since it is only used to help me but not used later when the customer uses the code.



Related Questions


What is IBM's CUPRIMDS?

Updated February 18, 2017 10:05 AM

What does stubbing mean in programming?

Updated March 03, 2017 13:05 PM

Integration tests, but how much?

Updated February 28, 2017 08:05 AM

i want a postman's counterpart for mobile developers

Updated December 05, 2017 07:05 AM