Web Development

Adding fixtures and parameterized functions to PyTest

Adding fixtures and parameterized functions to PyTest

  • March 11, 2021

As we discussed in our post on getting started with Pytest, the framework allows us to reuse tests by using test fixtures and parameterized functions. In this post, we will learn how to do so. We will build on the simple calculator example that we discussed in the previous post...

Testing Python applications using Pytest

Testing Python applications using Pytest

  • March 9, 2021

Testing our code brings in a variety of benefits, including building confidence in the code’s functioning and having lesser regressions. Writing and maintaining tests requires some additional work, and that is why we want to leverage tools as much as we can. Python does provide inbuilt tools such as unittest...

How to format a Number as Currency using ES2015

How to format a Number as Currency using ES2015

  • March 4, 2021

The process to format a number as currency can be a tedious task. It feels like a small task, but the number of lines and the edge cases can keep on increasing when considering factors such as internationalization and different formatting standards. Luckily, ES2015 introduced an internationalization API which can...

Getting started with Flask: a Python microframework

Getting started with Flask: a Python microframework

  • February 25, 2021

Flask is a python framework for writing web applications. It is a microframework, which as the name suggests, is a small, clean, and simple to use framework. It comes with a minimal set of features, which sounds like a strange choice at first. So why would we choose Flask if...

Managing Python dependencies using Virtual Environments

Managing Python dependencies using Virtual Environments

  • February 23, 2021

When we start building a Python project that goes beyond simple scripts, we tend to start using third-party dependencies. When working on a larger project, we need to think about managing these dependencies in an efficient manner. And when installing dependencies, we always want to be inside virtual environments. It...

JavaScript Proxy: What and Why?

JavaScript Proxy: What and Why?

  • February 16, 2021

EcmaScript 2015 introduced yet another feature that has not been used widely yet. A JavaScript proxy allows us to wrap an existing object with a layer. The layer can provide us with capabilities such as the interception of attributes and methods. And this can be done even if the properties...

Avoiding race conditions and memory leaks in React useEffect

Avoiding race conditions and memory leaks in React useEffect

  • February 8, 2021

Let us take a look at an implementation of getting data from an API request and see if there is any possibility of race conditions happening in this component: We have specified an empty array as a dependency to the useEffect React hook. So we have ensured that the fetch...

Object initialization shorthand notations in JavaScript

Object initialization shorthand notations in JavaScript

  • February 2, 2021

I was recently working on a project in which I was trying to use a shorthand notation for destructuring assignment of a variable. I was researching different ways of getting a specific scenario to work. And while doing that research, I found that ES2015 had added 3 new object initialization...