Posts in 'code'

Flask em 40 Minutos ou Menos: Iniciando

Como começar um script Flask.

Fugindo Para as Colinas Com Python

"Hello World" não mostra exatamente o poder de qualquer linguagem. Por isso resolvi fazer uma "introdução" ao Python com um problema de fujir para as colinas. Ou quase isso.

On Unit Tests and Layers, Part II

After coming with a discussion about unit tests and layers, I got a bunch of other insights, specially from a video of Gary Bernhardt about "Fast Test, Slow Test".

On Unit Tests and Layers

On a recent discussion about testing, I think I came up with a reason why some people really think we need to test everything: they are thinking in layers, without even realizing it.

Why Mixing Spaces and Tabs IS a Big Deal

Reading Reddit comments about How terrible code gets written by perfectly sane people when I read this comment:

mixed spaces/tabs for indentation

Is this a joke? I've been programming professionally from 2008 and I've not yet found an actual case where this was an actual problem. The code looks …

O "Unit" de "Unit Tests"

Existem vários artigos sobre os "testes de unidade" e alguns até falando de "a unidade dos testes"; todos estes estão errados e é preciso parar de falar dessa forma.

Python 2 + 3 = Six

"Six" é uma pequena biblioteca Python que pode ajudar você a passar o seu código de Python 2 para Python 3.

Mocking A Mock

Mocks are an important part of testing, but learn how to properly mock stuff.

When I Used PEP8 To Fuck Up Code

We "inherited" some Python code recently. Although another team was working on it, we now should support it and keep it going. The previous team at least tried to use Pylint and follow PEP8. And I say "tried" because their pylintrc has a couple of exceptions [1] and their PEP8 …

The Unit in "Unit Tests"

In the last month, I heard a lot about the "'unit' in 'unit test'", as in "the unit being tested". If you do that, stop.

The thing about "unit tests" is not that they are "tests for a system unit" but that "the test must be a unit" -- in other …