r/Python • u/RickSore • Nov 14 '17
Senior Python Programmers, what tricks do you want to impart to us young guns?
Like basic looping, performance improvement, etc.
1.3k
Upvotes
r/Python • u/RickSore • Nov 14 '17
Like basic looping, performance improvement, etc.
2
u/admiralspark Nov 16 '17
Any thoughts on how to run tests against code that requires connecting to a device and pulling information? My code connects to say, a network switch and pulls or works with data from that live system, so unless I can carry the switch with me (not happening) I can't reproduce 'tests' anywhere.
I considered building a test to feed the scripts static data but it would require a bunch of refactoring and changes that would complicate code intended to be simple enough for new network engineers to grab. But right now, I just run it against a switch and make the determination myself if it's right or not....plus, simulating an SSH session seems like a mountain of work.