Skip to content

tests: stop using parse_rfc3339 as the toml-test datetime oracle - #639

Open
ekanshul wants to merge 2 commits into
python-poetry:masterfrom
ekanshul:tests/independent-datetime-oracle
Open

ekanshul wants to merge 2 commits into
python-poetry:masterfrom
ekanshul:tests/independent-datetime-oracle

Conversation

@ekanshul

@ekanshul ekanshul commented Oct 7, 2026

Copy link
Copy Markdown

Summary

Fixes #603.

tests/test_toml_tests.py was building expected datetime values with tomlkit._utils.parse_rfc3339, so a bug in that helper would also change the expected value. The compliance corpus is no longer an independent check for those four types.

This PR:

  • Parses toml-test JSON temporal values with stdlib date/time/datetime.fromisoformat instead of parse_rfc3339.
  • Adds a +05:30 case to test_parse_rfc3339_datetime (no existing test used a non-zero minute offset).
  • Makes elementary_test compare the unwrapped value, not only its type.

Verified locally: 1098 passed.

Agent Drafting Metadata

  • Agent: Cursor
  • Model: Grok 4.6
  • Notes: I used Cursor to draft the independent oracle and the extra test cases. I reviewed the diff against the issue, and ran pytest tests (1098 passed) plus a smoke check of expected_temporal for date, time, Z, space-separated, and +05:30 inputs.

ekanshul and others added 2 commits October 7, 2026 17:45
Compliance tests built expected datetime values with parse_rfc3339,
so a bug in that helper and the parser could drift together. Build
those expectations with stdlib fromisoformat instead, add a +05:30
offset case, and assert unwrap() values as well as types.

Fixes python-poetry#603
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.

toml-test datetime cases use tomlkit's own parse_rfc3339 as the expected value, so they cannot detect datetime parsing bugs

1 participant