How To Get Logging Working In GKE And GCE

I wasn’t able to get GKE and GCE instances work with stackdriver when it came to logging. Luckily, my co-worker had faced the same problem as me and had (partially) fixed it.

»
Author's profile picture Daniel Gopar

Ordering Of Pytest Fixtures And Mock Patch Objects

If you’re using the mock library and pytest’s fixtures, then you might be confused for a second about the ordering. Mock objects go first and then pytests fixtures.

»
Author's profile picture Daniel Gopar on python and pytest

Tips For Other Jr Engineers

I’m a Junior engineer and here’s a couple of things I wish I knew or had more experience with before starting a job. Before I start I want to say that his is aimed for Students and other Junior Engineers that are in a similar situation (Some things you might already know or think it was obvious to know but this is my personal experience). Anyways, here it is:

»
Author's profile picture Daniel Gopar

Automatically Insert Jira Ticket In Maggit Commit

We use Jira where I work and I find it helpful to include the Jira issue/ticket number pre-populated within the commit message. This only works if the branch I’m working on starts with the Jira issue number. Otherwise it doesn’t input anything. Here’s the snippet that does so:

»
Author's profile picture Daniel Gopar on emacs

Fixtures From Type Annotations

I read this blog post about converting function/method arguments into what their type annotations mentioned they would be. You can read more from that link, but pretty much I got an idea that someone should be able to create fixtures from type annotations. Anyways, here’s a proof of concept just using the basic built-in types in Python.

»
Author's profile picture Daniel Gopar on python

Unittest equivalent of Pytest's Parametrize

I’m currently using the unittest framework for writing tests. One thing I miss is being able to use the @pytest.mark.parametrize decorator to test out different inputs. If you know about this feature, then you know why it’s so useful. Luckily, unittest has a similar feature that starting working since Python 3.4, it’s called subtests.

»
Author's profile picture Daniel Gopar on python