Quantcast
Channel: Planet Python
Viewing all articles
Browse latest Browse all 23202

Brian Okken: Testing some tidbits with pytest

$
0
0
I noticed a fun post by Ned Batchelder called Testing some tidbits. The post looks at different ways to see if a string has only 0 or 1 in it. He posted a few ways on Bluesky/Mastodon and got a bunch of replies with more ways. And then wrote a small script to check to see if they worked. It’s a fun post, and from it I learned about: cleandoc - a way to strip leading blank space and maintain code block indentation partition - splitting strings based on a substring Using | to pass imports to eval() - I don’t use eval much.

Viewing all articles
Browse latest Browse all 23202

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>