FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
My Python tests passed. Production still broke.
NewsProgramming Languages

My Python tests passed. Production still broke.

via Dev.to PythonNico Reyes4h ago

My Python tests passed. Production still broke. Pushed a fix to production Friday afternoon. All 47 unit tests green. Felt good about it. Monday morning: 200+ error logs. The code worked fine in tests but crashed on real data. What happened Built a data parser that cleaned product prices from scraped HTML. Test suite covered edge cases. Empty strings, None values, malformed numbers. Everything passed locally. Production data had something my tests never checked: Unicode characters mixed with numbers. $19.⁹⁹ instead of $19.99 . The superscript 9s came from copying prices that had footnote markers. My regex assumed normal digits. # What I tested def clean_price ( text ): if not text : return 0.0 match = re . search ( r ' \d+\.?\d* ' , text ) return float ( match . group ()) if match else 0.0 # Test that passed assert clean_price ( " $19.99 " ) == 19.99 assert clean_price ( "" ) == 0.0 assert clean_price ( None ) == 0.0 The regex matched 19. and stopped at the superscript 9. Converted to

Continue reading on Dev.to Python

Opens in a new tab

Read Full Article
2 views

Related Articles

The best way to protect your phone from a warrantless search in 2026
News

The best way to protect your phone from a warrantless search in 2026

ZDNet • 3h ago

Roku launches a standalone app for Howdy, its $2.99 streaming service
News

Roku launches a standalone app for Howdy, its $2.99 streaming service

TechCrunch • 3h ago

Meta launches two new Ray-Ban glasses designed for prescription wearers
News

Meta launches two new Ray-Ban glasses designed for prescription wearers

TechCrunch • 4h ago

You’re a Bad Friend. So I Built an App to Help.
News

You’re a Bad Friend. So I Built an App to Help.

Medium Programming • 4h ago

Aston Martin Valhalla (2026) Review: A $1 Million Plug-In Hybrid
News

Aston Martin Valhalla (2026) Review: A $1 Million Plug-In Hybrid

Wired • 4h ago

Discover More Articles