Running Flask Tests without installing the app
The Flask Docs have a great section for testing. However they assume that you have the app installed with pip install -e . which I almost never do. (Maybe I should start?) I have had trouble with this approach. So one little hack to inject your app into the searchable python path is to do something like this:
export BLOG_PATH=$(pwd) && python tests/blog_tests.py
tests/blog_tests.py file you import your flask app like this:sys.path.insert(0, os.environ.get('BLOG_PATH')) from blog.blog import app, init_db
Thank you for reading! Share your thoughts with me on bluesky, mastodon, or via email.
Check out some more stuff to read down below.
Most popular posts this month
- SQLite DB Migrations with PRAGMA user_version
- Edge Detection with Inkscape
- Using cgit
- Making cgit Pretty
- Lev Lazinskiy
Recent Favorite Blog Posts
This is a collection of the last 8 posts that I bookmarked.
- Pluralistic: Enshittification and Reverse Centaurs go global (29 Jul 2026) from Pluralistic: Daily links from Cory Doctorow
- AI Mania Is Eviscerating Global Decision-Making from Ludicity
- No-One Escapes the Permanent Underclass from Fernando Borretti
- Is it ethical to use AI? from charity.wtf
- The logical destination of LLMs from Andy Bell
- Revised rules of engineering leadership. from Irrational Exuberance
- The circus freaks of open source from Drew DeVault's blog
- Clanker: A Word For The Machine from Armin Ronacher's Thoughts and Writings
Articles from blogs I follow around the net
Now we have a timeline of the OpenAI accidental attack against Hugging Face
OpenAI gave a last-minute presentation at the Black Hat security on Wednesday about "the Hugging Face Incident" (previously on this blog). The video was published yesterday. It's short and information dense and well worth watching, in particular because it...
via Simon Willison's Weblog: Entries August 7, 2026Spoiler: Wil Wheaton is a Wizard
I am holding pink pages in my hand, reviewing them before I collate them into my script. A magic battle ensues between Wil and Bert (fireballs, energy bolts, conjured beasts, etc.) I look at the script again, to make sure I haven’t misread it. Yeah, it rea...
via WIL WHEATON dot NET August 7, 2026Seeing like a state
The post about the dark mode toggle reminded me of two similar things rattling in my brain. On the positive side, here’s a delightful interaction from macOS. I can easily maximize the window to take up half the screen, but the moment I start dragging it, i...
via Unsung August 7, 2026Generated by openring