Skip to content

FIX: Make test_features.FeaturesTest robust (fix #175)#248

Closed
JosefVacha wants to merge 2 commits into
jazzband:mainfrom
JosefVacha:fix/test-formatting-issues-175
Closed

FIX: Make test_features.FeaturesTest robust (fix #175)#248
JosefVacha wants to merge 2 commits into
jazzband:mainfrom
JosefVacha:fix/test-formatting-issues-175

Conversation

@JosefVacha
Copy link
Copy Markdown

Summary

Fix test failures in test_features.FeaturesTest on Python 3.9.6 (Issue #175).

Root Cause

The tests were comparing raw JSON strings (json.dumps() output) with hardcoded, multi-line strings. Python 3.9+ may have different default formatting for json.dumps(), causing the string comparison to fail.

Proposed Changes

  • test_protocol: Compare json.loads() objects instead of raw strings
  • test_feature_class: Compare json.loads() objects instead of raw strings
  • test_geo_interface: Compare json.loads() objects instead of raw strings

Verification

  • Tests no longer rely on specific JSON formatting
  • Compatible with Python 3.9+ formatting differences
  • Logic of the tests remains unchanged

Fixes #175.

JosefVacha and others added 2 commits May 25, 2026 11:44
…rmatting differences

- Replace string equality checks with JSON object comparison in test_protocol, test_feature_class, and test_geo_interface
- This fixes Issue #175 (failing test on Python 3.9.6) by avoiding reliance on specific json.dumps() formatting
- Tests now compare parsed JSON objects instead of raw strings

Fixes #175.
@JosefVacha JosefVacha closed this by deleting the head repository May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failing test test_features.FeaturesTest

1 participant