Recent posts

Allure2: A GUI for your code tests

August 13, 2017

In my previous post I touched on the basics of how you can use pytest to test your code. In this post I’ll be covering how you can use Allure2 to prettify your pytest results. Allure2 Adapter for pytest The first thing we need to is install the Allure adapter for Pytest. As the documentation states, this repository contains a plugin for py.tes...

Python: Shadowing

July 17, 2017

In my previous post, Python: Scope, I touched on the topic of Shadowing. In this post I’ll be delving deeper into it. As Wikipedia says, variable shadowing occurs when a variable declared within a certain scope (decision block, method, or inner class) has the same name as a variable declared in an outer scope. There are some interesting debate...

Python: Scope

July 16, 2017

Scope is the term used to define the location(s) in which Python searches for a name to object mapping (e.g a variable). As described in this StackOverflow post, Python uses the LEGB Rule to locate a definition. LEGB stands for: L, Local — Names assigned in any way within a function (_def _or lambda_)), and not declared global in that funct...

Python: Everything is an Object & First Class Citizens

July 14, 2017

A lot of Python books often mention that “everything in Python is an object”, and “objects are first class citizens”, but they don’t always explain what that these things actually mean. Let’s try to fix that up now. Everything in Python is an Object Dive Into Python gives a great explanation: Different programming languages define “object” in...

Python: if name == “main

July 13, 2017

There are plenty of articles on the internet that attempt to explain what if name == “main“ is and what it does, but (in my humble opinion), the examples are too complex more often than not. With that in mind, this post is aimed at being the most simplest explanation on the planet! :) What does it do? This statement is used when you want your ...