aboutsummaryrefslogtreecommitdiff
path: root/dateutil
AgeCommit message (Collapse)Author
2019-06-11Upgrade python/dateutil to 2.8.0Haibo Huang
Exempt-From-Owner-Approval: Upgrade library Test: build Change-Id: Ia9c1991e6598e1c97f8f01244ffbddf994c46763
2019-02-04Add tests for multiple EXDATE and DTSTART valuesPaul Ganssle
2019-02-04Factor rrule datetime value parsing into a methodNicolas Evrard
The logic for DTSTART, EXDATE and RDATE is substantially similar, so it makes sense to factor this out into a separate method.
2019-02-04Add EXDATE parameter parsing to rrulestrPaul Ganssle
Per RFC 5545 Section 3.8.5.1, exception dates should support VALUE and TZID parameters. This commit adds support for the full grammar of EXDATE.
2019-02-04Add tests for EXDATE parameter parsingPaul Ganssle
This adds a mix of failing and passing tests all of which must pass in order to close GH issue #410. These test a hopefully representative sample of supported parameter combinations, though all combinations are not exhausted.
2019-02-03Catch UnicodeEncodeError for Windows in tz.gettzPaul Ganssle
On Windows and Python 2.7, calling `tzwin` with a non-ascii name will raise a UnicodeEncodeError instead of WindowsError, as it does on other platforms and versions. Fixes GH #802.
2019-02-03Update tzdata to 2018iPaul Ganssle
2019-02-02Short circuit evaluation of pytest get_markerNicolas Evrard
No version of pytest that works on Python 3.3 supports the get_closest_marker method, and pytest >= 4.0 *only* supports get_closest_marker, so we must retrieve item.get_marker *if and only if* we cannot retrieve get_closest_marker.
2018-11-13Skip coverage on xfailed testsPaul Ganssle
This automatically attaches the `no_cover` marker to anything marked `xfail` *if* the `xfail` condition is met. This allows us to do the test coverage in one run instead of two.
2018-11-13Add test for un-folding a datetimePaul Ganssle
2018-11-13Test error condition in _DatetimeWithFold.replacePaul Ganssle
2018-11-13Add test for _DatetimeWithFold.replacePaul Ganssle
This ensures that positional arguments can be passed successfully
2018-11-13Convert EnfoldTest to pytest-style assertionsPaul Ganssle
2018-10-27Update tzdata to 2018gPaul Ganssle
2018-10-16Cleanup to strong cache additionPaul Ganssle
2018-10-16Add LRU caching to tzoffset, tzstr and gettzGökçen Nurlu
Caching had been switched to use `weakrefs` in order to reuse instances if they are still alive, by #635. This introduces a LRU cache to the mentioned functions in order to prevent the instances created by them getting dealloc'd and alloc'd unnecessarily, in situations like this: ```python for i in range(100): tz.gettz('America/New_York') ``` `tz.tzoffset` and `tz.tzstr` get a LRU cache with size of 8. `tz.gettz`'s cache starts with 8 by default and can be modified by the introduced `tz.set_cache_size(int)` Closes #691
2018-10-06Regroup if statements in tzname logicPaul Ganssle
This makes the grouping of the logic clearer; UTC is used either in the first group or the second group.
2018-10-06Accept 'z' for UTC in parserCheuk Ho
2018-10-06Accept 'z' for 'Z' in isoparseCheuk Ho
2018-09-24Merge pull request #767 from jbrockmendel/septestsPaul Ganssle
Separate out input_format tests
2018-09-24Refactor input testsPaul Ganssle
The setup_class method doesn't happen to be necessary in this case so I've refactored it out.
2018-09-24Separate out input_format testsBrock Mendel
2018-09-24Remove unnecessary binary_type compatibility shimJon Dufresne
The bytes type is available on all supported Pythons. Can remove workaround and make the code more forward compatible with Python 3.
2018-09-08Always use io.BytesIO/StringIO over six; on all supported PythonsJon Dufresne
More forward compatible by slightly reducing unnecessary use of the six library.
2018-09-02Improve tzname_in_python2 decoratorPaul Ganssle
This improves the ability to inspect wrapped tzname methods in Python 2 and removes an unnecessary function call (to the nested function) in Python 3. From my measurements, this is about twice as fast in Python 3 and approximately the same speed in Python 2.
2018-09-02Improve handling of base offset shiftsPaul Ganssle
This fixes a bug with the transition time of the Samoan base offset change (UTC-10 -> UTC+14), relating to the fact that it occurred during DST. When cleaning that up, I discovered a cleaner way to handle the issue of Portugal's base offset shift without a corresponding total offset shift, obviating the need for a second traversal of the transition list.
2018-09-02Add failing test for bug with Samoan offset changePaul Ganssle
2018-08-14Modify badzone test and add new xfailPaul Ganssle
The original badzone test fails for a different reason on Windows, so that has been changed to a Windows-specific xfail for GH issue #802, and a new cross-platform badzone test added.
2018-08-14Stop trying to store None in weakref cachePaul Ganssle
None is a singleton and a weak reference to it will never expire, and in this case it is used more as a soft failure mode than as an actual value to return. By special-casing this, the invariant that: gettz(x) is gettz(x) is preserved in all cases *except* when something on the underlying system changes such that `x` does not refer to a valid time zone in the first call, but does refer to a valid time zone in the second call. This could happen if `x` is added to the zoneinfo data, or if the local time zone changes such that `x` is now a valid specifier for the local time.
2018-08-14Add failing test for tz.gettz returning NonePaul Ganssle
This fails when gettz tries to store a weak reference to None.
2018-08-11Add test cases for positive offsetsBradlee Speice
2018-07-23Use Python3.7's nullcontext if availablePaul Ganssle
The _ContextWrapper class was added before nullcontext was added to the standard library. When available, we should prefer to use nullcontext.
2018-07-03Accept more than 6 fractional digits in `isoparse`Jay Weisskopf
RFC 3339 does not specify a limit to the number of fractional digits that can be provided. In the wild, languages like Go will provide up to 9 digits by default. Since the standard library's `datetime` only supports precision down to microseconds, any extra digits in the fractional component are truncated. Fixes #786
2018-07-02Run test suite against custom system zoneinfo filesPaul Ganssle
2018-06-22Convert test_import_star to pytest testPaul Ganssle
2018-06-22Remove calls to deprecated self.assertEqualsPaul Ganssle
2018-06-21Clarify the relativedelta documentationAndrew Bennett
This adds a general description of relativedelta and also tweaks the documentation of the weekday parameter.
2018-06-21Correct relativedelta doctestAndrew Bennett
2018-06-20Merge pull request #762 from prdickson/#623-no-docs-for-rrulestrPaul Ganssle
#623: added documentation for rrulestr function
2018-06-20Tweak rrulestr docstring formattingPaul Ganssle
2018-06-20#623: added documentation for rrulestr functionPaul Dickson
2018-06-20Added tests for parse_isotime error conditionPaul Ganssle
In the standard, 24 is only allowed as an hour at midnight exactly, these tests ensure that while 24:00 and its variations are allowed, non-midnight times with hour==24 fail.
2018-06-20Fix bug in parse_isotime when hour is 24Paul Ganssle
The old behavior parsed the string, modified the 24 component to 0 and then parsed the string a second time, passing an unmodified version to the datetime.time constructor.
2018-06-20Add test for parse_isotime with 24:00Paul Ganssle
Test is currently failing due to a bug in the parse_isotime implementation.
2018-06-20Add test for invalid separator in ISO stringalistair
2018-06-18Switch sub-minute offset tests to use pytest conventionsPaul Ganssle
2018-06-18Allow partial minutes for python 3.6 or newerSherry Zhou
- Add "Africa/Monrovia" to test_resolve_imaginary test for python 3.6 or newer - Test that partial minutes is supported in python 3.6 or newer for tz.tzfile and datetime.utcoffset - Enable partial minutes in both tz.tzoffset and tz.tzfile - For now, don't warn user when rounding to nearest minute for python pre-3.6
2018-06-18Add signs to components of relativedelta in doctestNicholas Herriot
2018-06-08Full test coverage on relativedeltaLuca Ferocino
2018-06-08Improved docstrings for count and until parametersLuca Ferocino