frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Hypothesis: Property-Based Testing for Python

https://hypothesis.readthedocs.io/en/latest/
24•lwhsiao•1h ago

Comments

NortySpock•19m ago
I keep thinking I have a possible use case for property -based testing, and then I am up to my armpits in trying to understand the on-the-ground problem and don't feel like I have time to learn a DSL for describing all possible inputs and outputs when I already had an existing function (the subject-under-test) that I don't understand.

So rather than try to learn to black boxes at the same time , I fall back to "several more unit tests to document more edge cases to defensibly guard against"

Is there some simple way to describe this defensive programming iteration pattern in Hypothesis? Normally we just null-check and return early and have to deal with the early-return case. How do I quickly write property tests to check that my code handles the most obvious edge cases?

fwip•10m ago
I think the easiest way is to start with general properties and general input, and tighten them up as needed. The property might just be "doesn't throw an exception", in some cases.

If you find yourself writing several edge cases manually with a common test logic, I think the @example decorator in Hypothesis is a quick way to do that: https://hypothesis.readthedocs.io/en/latest/reference/api.ht...

disambiguation•31s ago
I've only used it once before, not as unit testing, but as stress testing for a new customer facing api. I wanted to say with confidence "this will never throw an NPE". Also the logic was so complex (and the deadline so short) the only reasonable way to test was to generate large amounts of output data and review it manually for anomalies.
dbcurtis•9m ago
It’s been quite some time since I’ve been in the business of writing lots of unit tests, but back in the day, I found hypothesis to be a big force multiplier and it uncovered many subtle/embarrassing bugs for me. Recommend. Also easy and intuitive to use.

The Microchip Era Is About to End

https://www.wsj.com/opinion/the-microchip-era-is-about-to-end-e71eb66a
1•bogomipz•44s ago•0 comments

Show HN: Notifikai – Set and get reminders through simple text messages

https://notifikai.com
2•libiny•7m ago•1 comments

OneNote's Genesis (2004)

https://web.archive.org/web/20170327080319/https://blogs.msdn.microsoft.com/chris_pratley/2004/01...
1•mickelsen•10m ago•0 comments

Show HN: Free Quantum-Resistant Timestamping API (Dual-Signature and Bitcoin)

2•sasasavic•13m ago•1 comments

Papers retracted for using a copyrighted questionnaire

https://lee-phillips.org/questionnaireRetraction.html
3•leephillips•14m ago•0 comments

How to Run N8n for Free Forever on Google Cloud

https://medium.com/ai-mind-labs/how-to-run-n8n-for-free-forever-on-google-cloud-e15940f33ed0
2•rovmut•16m ago•0 comments

The Text Sizing Protocol

https://sw.kovidgoyal.net/kitty/text-sizing-protocol/
2•vinhnx•18m ago•0 comments

Brand Story and Philosophy – #4 John Wainwright – Pioneering Programmer

https://hyperflow-ai.com/
1•hyperflow-ai•23m ago•1 comments

Show HN: Anonymous Peer to Peer Therapy

https://apps.apple.com/us/app/hummm-messenger/id6754100488
2•lakshmananm•24m ago•0 comments

How I manage my medical condition (Year in Remission)So I Can Work on My Startup

1•iliaov•29m ago•0 comments

Theory – how to make it so nobody's poor

2•AdityaNa15•32m ago•0 comments

Inspiration (2024)

https://tdhopper.com/blog/on-inspiration/
1•vinhnx•34m ago•0 comments

California Approves Redistricting Plan

https://www.nytimes.com/live/2025/11/04/us/election-new-jersey-california
3•JumpCrisscross•35m ago•4 comments

Generalizing Test-Time Compute-Optimal Scaling as an Optimizable Graph

https://huggingface.co/papers/2511.00086
2•veryluckyxyz•37m ago•0 comments

Russia blocks Ookla's Speedtest due to internet security threats (July 2025)

https://www.reuters.com/sustainability/society-equity/russia-blocks-ooklas-online-speedtest-servi...
2•cobertos•37m ago•0 comments

PostgreSQL 18 – Virtual Generated Columns

https://hashrocket.com/blog/posts/postgresql-18-virtual-generated-columns
1•doppp•44m ago•0 comments

Voice Processing and Synthesis by Performance Sampling and Spectral Models(2008)

https://web.archive.org/web/20240731004804if_/https://www.tdx.cat/bitstream/handle/10803/7555/tjb...
1•q7m•45m ago•2 comments

Epic vs. Google settlement: Opening up Android

https://twitter.com/TimSweeneyEpic/status/1985920786545123613
13•azhenley•51m ago•0 comments

Commitments on Model Deprecation and Preservation

https://www.anthropic.com/research/deprecation-commitments
1•dgs_sgd•51m ago•0 comments

Show HN: Google Notebook LM for your team

http://thytus.com
1•martinoV•56m ago•0 comments

NASA's Orion Space Capsule Is Flaming Garbage

https://caseyhandmer.wordpress.com/2025/10/31/nasas-orion-space-capsule-is-flaming-garbage/
2•surprisetalk•1h ago•1 comments

What Happens When All Training Data Is AI Generated? [video]

https://www.youtube.com/watch?v=Bs_VjCqyDfU
1•surprisetalk•1h ago•0 comments

In Pursuit of Democracy

https://pudding.cool/2025/11/democracy/
2•surprisetalk•1h ago•0 comments

Grokipedia or Slopipedia? Is It Truthful and Accurate?

https://www.mindprison.cc/p/grokipedia-or-slopipedia-is-it-truthful-accurate
2•13years•1h ago•1 comments

Show HN: Generate custom MTA Subway displays

https://mtadisplay.ryangeary.dev/
1•theryangeary•1h ago•0 comments

Oracle default fears surge as credit swaps spike – is AI taking its toll?

https://economictimes.indiatimes.com/news/international/us/oracle-default-fears-surge-as-credit-s...
10•moose_man•1h ago•3 comments

Crypto Hit by Bitcoin Whales Dumping $45B in Bets

https://www.bloomberg.com/news/articles/2025-11-05/crypto-hit-by-bitcoin-whales-dumping-45-billio...
2•moose_man•1h ago•2 comments

Tom Brady says his dog is a clone of family's previous pet

https://www.espn.com/nfl/story/_/id/46848973/tom-brady-says-dog-clone-family-previous-pet
1•cachecrab•1h ago•0 comments

3D Wave Function Collapse in GDScript (Godot)

https://github.com/crwedman/crwtiles
2•underscoremark•1h ago•1 comments

Tesla says Musk should be paid $1T – will shareholders agree?

https://www.bbc.com/news/articles/cn4j0yg1drgo
2•grugagag•1h ago•0 comments