GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||
GeezerVison is showing github.com — gh-107862: Add property tests for strftime/strptime by pganssle · Pull Request #124550 · python/cpython Conversation
|
|
Attached Hypothesis meta issue #107862 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Add the missing timezones strategy stub and an explicit example so the test runs without Hypothesis installed. Use the C locale for the example to keep the composite format independent of the ambient locale.
Add a separate pure-Python test class using the same properties as the C implementation. Give its strptime module matching Python timezone classes and restore the module cache when the tests finish.
Correct the round-trip preconditions and preserve the minimized failures as explicit examples. Generate delimited fields, account for ignored week numbers and two-digit years, and keep locale composites in the C locale. Check small years and ambiguous fields against independent expected values.
Construct numeric, ordinal, ISO-week and calendar-week inputs without strftime, and compare parsed fields against date arithmetic. Keep leap days, year boundaries and the two-digit-year pivot as explicit examples.
Check fractional precision and signed offset components independently of datetime equality. Cover colon and compact spellings, Z, naive inputs, negative zero and offsets immediately inside the 24-hour boundary.
Mutate otherwise valid dates into impossible calendar dates, out-of-range clock fields and offsets, malformed fractions and incomplete ISO dates. Check ValueError without treating permissive but valid spellings as errors.
Use independent C-locale name tables and exercise case variants, 12-hour clock boundaries and Unicode whitespace. Keep NUL, surrogate, percent and regex punctuation literals in the parser domain even where libc strftime cannot round-trip them.
Compare date, time, datetime and struct_time results against independently constructed fields. Cover partial-input defaults, discarded components, ISO and ordinal dates, and agreeing redundant directives.
Week 53 and ordinal day 366 can normalize into the following year while tm_yday remains relative to the input year. Preserve the independently calculated date and day-of-year assertions as an expected failure until this inconsistency is resolved.
Conflicting repeated years should raise ValueError, but compiling the format leaks re.PatternError for the duplicate named group. Keep this failure separate from the passing mixed-directive property.
Parse localized names while switching from C to an available non-C locale and back. Build numeric fields independently, including years below 1000, and restore the caller locale after the test.
Permute agreeing date, clock and offset representations and compare the result with independently known fields. Cover calendar versus ISO years, 12-hour versus 24-hour clocks and both numeric offset directives.
bc0286c to
b43a3f5
Compare
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.