Python on the Train, Part 1

Python on the Train, Part 1

My plan is to not work out of hours any more, not even Python courses as I have a bit of time to complete the only ones I really need to do at work, but I got on the train and couldn't handle the prospect of doing nothing for 2 hours.

I don't want to write it all up because I get it and I find it easy. And unittest is not what I use.

Although the concepts are helping me to understand testing better - I don't ned to memorise the syntax or anything like that (and anyway by not trying to I am). I really should be chilling but nevermind. Once I have reached the point of feeling like I can't learn more - I will chill then.

But I don't really like working outside of hours.

"There is another group of assertion methods related to exceptions and warnings"

  • self.assertRaises() this is interesting because my boss told me that if we are expecting our code to raise a certain type of exception, then we should test for it as well. So while I will not be using this kind of exact syntax, this kind of lesson is really helping me to understand my code anyway.
  • The lesson says that you can't actually recreate this and self.assertWarns() very easily using general coding syntax, so it recommends using these methods - BUT HOW IF YOU DON'T USE unittest??!

Parameterizing Tests

(It's too early for this)
(Why am I not back in bed)
(It's 7.31 am for real tho I left the house like about an hour ago).

Parameterizing Tests

test parameterization

"By parameterizing tests, we can leverage the functionality of a single test to get a large amount of coverage for different inputs."

Oh no there's something about context management - I think that's still coming up - whoops. I don't know if the way we test in my niche AI experiments repo has an equivalent or not. I will have to ask my team.

Test Fixtures

Arrrrgh and no and this is too long please and I am almost at Victoria and I want to look at London please... to be continued, sorry.

An image of a train; text reads; Python on the train.
I wrote this all on the train but made this in 3 minutes at work while waiting on a colleague because the internet on the trains is questionable.



Comments

Popular posts from this blog

Hello World

Yosemite

Two Lines of Thought, Makes Me Wonder What I'm Missing