Loading...
Loading...

About the show
Sponsored by us! Support our work through:
Brian #1: Better Python tests with inline-snapshot
Allows you to write a test like this:
from inline_snapshot import snapshot
def test_user_creation():
user = create_user(id=123, name="test_user")
assert user.dict() == snapshot({})
Then run pytest --inline-snapshot=fix
And the library updates the test source code to look like this:
def test_user_creation():
user = create_user(id=123, name="test_user")
assert user.dict() == snapshot({
"id": 123,
"name": "test_user",
"status": "active"
})
Now, when you run the code without “fix” the collected data is used for comparison
Michael #2: jolt Battery intelligence for your laptop
Brian #3: Markdown code formatting with ruff
ruff can now format code within markdown filespython, py, python3 or py3.pyi as Python type stub files.<!-- fmt:off --> , <!-- fmt:on --> blocks.[tool.ruff.lint]
preview = true
Michael #4: act - run your GitHub actions locally
.github/workflows/ files (or for any changes to embedded GitHub actions), you can use act to run the actions locally. The environment variables and filesystem are all configured to match what GitHub provides.act, you can use the GitHub Actions defined in your .github/workflows/ to replace your Makefile!act it reads in your GitHub Actions from .github/workflows/ and determines the set of actions that need to be run.
Extras
Michael:
Joke: Plug ‘n Paste
No transcript available for this episode.

Python Bytes