Knowledge Bits References I wish I'd already found
Atom · RSS

Python

Python is an interpreted, high-level, duck- & dynamically-typed programming language known for its whitespace-significant pseudocode-like syntax and its comprehensive standard library.

Articles Tagged with “Python”

Atom · RSS

Python Asynchronous Programming Fundamentals

Python introduced asynchronous programming capabilities in version 3.4 in 2014, with further notable improvements in almost every minor version since. However, to many Python programmers, this area of the language remains esoteric, misunderstood, and underutilized. This article aims to elucidate the fundamental concepts of asynchronous programming as part of the first step towards mastery.



Skipping Pytest Tests Unless an Option is Given

When testing Python code with pytest, you may occasionally write tests that you only want to run under special circumstances, such as long-running tests that should only be run under continuous integration and not when invoking pytest locally. The naïve way to accomplish this is to decorate the tests in question with a pytest mark like @pytest.mark.slow and then specify -m "not slow" when running pytest locally, but then you have to remember to pass this option every time, and if you hardcode it into your tox.ini or pytest configuration, you’ll need something else to remove it when testing under CI. Fortunately, there are better ways to make pytest skip tests by default.