-
Notifications
You must be signed in to change notification settings - Fork 479
Fixing #894 and correcting tests #901
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
Changes from all commits
5583f3a
fff5112
a77cb4c
3a93e8a
0ea06bc
4e729e8
5773f76
b169301
fba58dd
2aff295
5d8e3d5
c21e428
34f49b9
50c1d30
0563be4
c089907
dbd12ec
4343cd4
2ff140e
14bb443
840e2a3
2f61776
4810bc6
95fbe1d
61bfe13
98b6ba6
da1c1c3
ff1e856
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -461,15 +461,16 @@ def test_search_and_parse(self, shortname, string, expected, settings=None): | |
January UTC | ||
June 5 am utc | ||
June 23th 5 pm EST | ||
May 31, 8am UTC""", | ||
May 31 | ||
8am UTC""", | ||
Gallaecio marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[('May 2020', datetime.datetime(2020, 5, datetime.datetime.utcnow().day, 0, 0)), | ||
('June 2020', datetime.datetime(2020, 6, datetime.datetime.utcnow().day, 0, 0)), | ||
('2023', datetime.datetime(2023, 6, datetime.datetime.utcnow().day, 0, 0)), | ||
('January UTC', datetime.datetime(2023, 1, datetime.datetime.utcnow().day, 0, 0, tzinfo=pytz.utc)), | ||
('June 5 am utc', datetime.datetime(2023, 6, 5, 0, 0, tzinfo=pytz.utc)), | ||
('June 5 am utc', datetime.datetime(2023, 6, datetime.datetime.utcnow().day, 5, 0, tzinfo=pytz.utc)), | ||
('June 23th 5 pm EST', datetime.datetime(2023, 6, 23, 17, 0, tzinfo=pytz.timezone("EST"))), | ||
('May 31', datetime.datetime(2023, 5, 31, 0, 0)), | ||
('8am UTC', datetime.datetime(2023, 8, 31, 0, 0, tzinfo=pytz.utc))]), | ||
('8am UTC', datetime.datetime(2023, 5, 31, 8, 0, tzinfo=pytz.utc))]), | ||
Comment on lines
+470
to
+473
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the parsing of I checked and that test string was added as part of a performance improvement, #881, and I imagine it does not come from an actual case found in the internet, which makes it hard to argue either way. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, I guess you are right that fixing it is out of the scope of this change and should be a separate issue. It was just bad luck that your change broke it, or rather it was just dumb luck that it was working in the first place. However, what I would do here is move that scenario into a separate test, with the previous value, and mark the test as an expected failure (xfail), to make it clear that the expected outcome is still the old one, only that Dateparser does not support it yet. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great after this PR is merged I will create an issue and create a supporting PR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don’t forget the xfail part, though, I do think that needs to be addressed in this pull request, instead of changing the test expectations. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am working on it now and by the time you create separate test, with the previous value, and mark the test as an expected failure (xfail) it should be done There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I was hoping for you to do that, as it needs to be done as part of this pull request (which is the one that causes the test to fail). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok on it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems it is broken throughout
or
Which is incorrect. I am working on the patch but it will require some time and significant change in other parts of the library and many tests will be broken because they are also incorrect. Or the current interpretation is correct. |
||
|
||
# Russian | ||
param('ru', '19 марта 2001 был хороший день. 20 марта тоже был хороший день. 21 марта был отличный день.', | ||
|
Uh oh!
There was an error while loading. Please reload this page.