python

Python Module - jsonschema Part 1

This article is part of a tutorial series about the Python module - jsonschema:

JSON is currently one of the mainstream data interchange formats. However, if you want to validate the format of JSON data in your program, you’ll need to spend some effort writing validation code. Fortunately, JSON Schema simplifies the process of validating JSON formats. If you’re using JSON as the data exchange format for an API, you might consider using JSON Schema for validation.

JSON Schema is a vocabulary that allows you to annotate and validate JSON documents.

Posted on  Mar 20, 2018  in  Python Module/Package Recommendations  by  Amo Chen  ‐ 5 min read

Recording Test Duration with Python pytest

Recently, I read an article titled Timing Tests in Python for Fun and Profit, which is well worth a read. The article discusses how to find test cases that need speed improvement by recording their execution time (and in the process, you might also discover code with poor performance).

However, I often use pytest, so I spent some extra time finding out how to achieve the same in pytest.

Posted on  Nov 20, 2016  in  Python Module/Package Recommendations  by  Amo Chen  ‐ 2 min read