-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Datetime features #729
Datetime features #729
Conversation
5eda3c5
to
c481d50
Compare
start_date: 1999-12-31 11:59:00 | ||
end_date: now | ||
timezone: | ||
relativedelta: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there other options besides relativedelta
? Is there a syntax to specify a timezone with a traditional abbreviation? (e.g. timezone: PST
)
basedate: ${{datetime("2022-01-01", year=2000, month=1, day=1)}} | ||
dateplus: ${{basedate + "XYZZY"}} | ||
""" | ||
with pytest.raises(exc.DataGenValueError) as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could save a line by using the match
argument. My regex-fu could be off here though :)
with pytest.raises(exc.DataGenValueError) as e: | |
with pytest.raises(exc.DataGenValueError, match=r'/date specification/') as e: |
with pytest.raises(exc.DataGenError) as e: | ||
generate(StringIO(yaml), {}, None) | ||
|
||
assert "date specification" in str(e.value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
Add
datetime_between
featureAllow datetimes to be parsed from strings
Allow datetimes to be coerced from dates