Morning Music Gaining Confidence Through Streaming and Making a Red-Green unittest Enhancement
I wake up to Spoon. Specifically Small Stakes.
It's been the first thing I've kicked off for a month now. If the process of waking up goes from one to ten, I hover around 2-3 for fifteen minutes without music. Turn on Small Stakes, though, and I'm at a 6 within seconds. Highly recommended.
I did a four hour stream last night. Start off working on the Django tutorial I'm building in order to learn the framework. Going Docendo Discimus style. I completed the first example of doing tests. That was a good stopping point.
The next thing I worked on was a little Python module to set the output of unittest to red if tests fails and green if they pass. For some reason I don't understand, unittest always show red. I just looked up the term I've been trying to remember in Information Dashboard Design, it's "preattentive processing". A set of visual attributes that we process on a subconscious level. Color is one of those. So, we can, for example, figure out if something passed or failed in unittest without having to read the output just based on the color.
I had very little idea of what I was doing to start with. Like, I didn't even know the basics of how to setup a module. There was an echo of uncomfortableness, but I just got into it and then basically didn't worry about not knowing what I was doing. Streaming is definitely helping me get better at that.
I'm into this module now. I'm going to work on it again today. I'm thinking I can set it up as a class that inherits unittest and so you can use it as a drop-in replacement instead of a separate call. Also, I'll look to see how to publish it up to pip. Oh, and I'm going to setup so you can control the colors somehow so that it's accessible for folks with different levels of color-blindness.
There's at least one question one StackOverflow about setting the output colors to red/green. So, maybe I could get a few people using it. Of course, the best thing would be if the unittest folks picked up the idea and implemented it directly so that it was a native feature. (Which, I realize now I never checked on, but I'm assuming because there wasn't a StackOverflow answer pointing that out that it's not the case.) And, who knows, maybe I'll submit a pull request to unittest to add it. (Which is hard to believe no one has done yet. I suppose they have their reasons. I'm curious to hear them because I can't imagine them.)
Anyway, streaming continues to help me gain confidence in attempting new things.