techhub.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A hub primarily for passionate technologists, but everyone is welcome

Administered by:

Server stats:

4.9K
active users

#UnitTesting

4 posts3 participants0 posts today
Replied to John-Mark Gurney

@encthenet @rachelplusplus Dunno if you've considered this, or would consider it, but pytest has a plugin, pytest-fakefs (github.com/pytest-dev/pyfakefs), that implements an in-memory filesystem complete with file objects that you can use to test file handling code without having to put things on disk. IMO the plugin ecosystem for handling things like this is one of pytest's biggest advantages over unittest.

Or if you prefer, pytest also has built-in functionality that makes working with temporary files pretty easy.

GitHubGitHub - pytest-dev/pyfakefs: Provides a fake file system that mocks the Python file system modules.Provides a fake file system that mocks the Python file system modules. - pytest-dev/pyfakefs

A couple weeks ago, I gave a talk at @omt_conf on What's New in Testing. That talk was recorded, but while I wait for it to be edited and published, I published an edited (and updated!) version of my speaker notes from that talk.

There's a lot new in testing since last year. I'm still surprised there wasn't a WWDC video about all the new things you can do.

rachelbrindle.com/2025/06/26/w

rachelbrindle.comWhat's new in Testing, 2025 EditionPilot. Software Engineer. Building an Electric Airplane

I made a small tool called SpecSCAD to help write unit tests for #OpenSCAD functions using a #BDD-style syntax (describe, it, expect), inspired by Mocha/Jest. #UnitTesting

It runs @OpenSCAD in headless mode via Bash and outputs simple pass/fail results. No external dependencies beyond OpenSCAD + Bash.

It’s very lightweight, but can help to catch issues early in function-heavy code. Maybe it’s useful to others too — feedback welcome!