| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
Move the project to the src layout to ensure we are testing on the
generated package rather than the checked out source tree.
|
| | |
|
| |
|
|
|
| |
This uses PEP 562 to implement lazy loading of submodules in dateutil
(GH-771).
|
| |\
| |
| | |
Add and xfail unhandled case #1029
|
| | | |
|
| |\ \
| | |
| | | |
Migrate away from unittest and adopt pytest
|
| | | |
| | |
| | |
| | | |
Part of a series of commit that is moving the suite.
|
| |\ \ \
| | | |
| | | | |
migrate away from unittest and adopt pytest for test_internals.py
|
| | | | | |
|
| |\ \ \ \
| |_|/ /
|/| | | |
isoparse: Fail with inconsistent time separators
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The test was meant to validate `parse_isodate` but was using
`parse_isotime` instead. Move the test case to the list validating
invalid formats.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Fail when separators are used inconsistently to split the time porting
of a string. Even if more restrictive, we have warned that we were going
to fail on invalid cases of ISO formatted strings. This will prevent
invalid iso formatted strings from being unexpectedly parsed.
|
| |\ \ \ \
| | | | |
| | | | | |
Call .decode() only for binary data
|
| | | |_|/
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | | |
We can handle both bytes and bytearray in the same way in Python 2 and
Python 3.
Co-authored-by: Mario Corchero <mariocj89@gmail.com>
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
As the function is wrapped around a decorator that converts the input to
bytes, when an exception is raised that includes the value, it contains
the value as bytes (b"<val>"). To provide the expected str in Python 3,
decode that to unicode.
This will result in `u""` for Python 2 callers, but given that we plan
to drop support for Python 2 in the short term, it feels acceptable.
|
| | |/ /
|/| |
| | |
| | | |
Save an unnecessary len call.
|
| |\ \ \
| | | |
| | | | |
Update zoneinfo to 2021a
|
| | | | | |
|
| |/ / /
| | |
| | |
| | |
| | |
| | | |
Tests are failing in CI on pypi for windows. The function is returning
an empty string rather than raising. This commit adapts the logic to
skip those cases.
|
| |/ /
| |
| |
| |
| |
| |
| | |
At the moment, we do not support Version 2 files (see GH-590), and many
zones will be inaccurate *today* when dateutil.tz is used with a slim
binary. For the moment, we'll force fat binaries. In the long term,
we'll migrate to something like zoneinfo.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The current tests only check that `tz.gettz()` and `tz.gettz("")` do
the same thing, but not that the thing that they do is equivalent to a
local time zone.
Defining what is a "local time" is a bit complicated, considering that
`tz.gettz()` may return a `tzfile` or a `tzlocal`, and neither of those
have the same behavior as Python's built-in local time support via
`.astimezone()`. This property test checks only the datetimes and
properties that are expected to be the same between the various methods
of getting a "local" time zone.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The documented behavior of the function is to return a local time zone
when the argument is None or an empty string.
This was working if the TZ environment variable was set, but not working
otherwise.
Fixes #925, #926
|
| |\ \
| | |
| | | |
Fix simple typo: negilible -> negligible
|
| | | |
| | |
| | |
| | | |
Closes GH-985
|
| |\ \ \
| |/ /
|/| | |
Update zoneinfo to 2020a
|
| | | | |
|
| |/ /
| |
| |
| |
| | |
autodoc will inspect the __doc__ attribute of the method. Since the decorator
replaces the original method we use functools.wrap to copy __doc__.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
Periodic update of all links that point to redirects or http targets
when an https target is available.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This was originally dead code, because an indentation error had `__repr__`
defined after the `return` statement in `__str__`. The definition of the
`__repr__` is also changed to be more in line with the conception of a
repr as "what you would have to evalue to get this object".
Even though this is not guaranteed behavior, this commit also adds a
regression test to avoid simple errors like this in the future.
|
| |/
|
|
|
|
|
|
|
|
|
| |
In attempting to pass-through the string representation of an exception
we are wrapping, we made the erroneous assumption that `args[0]` would
always be a string (or something that can concatenate cleanly with a
string). This turns out not to be the case with `IllegalMonthError`,
where it is an integer, so to avoid raising an erroneous `TypeError`, we
first convert the wrapped exception to a string.
See GH issue #981.
|
| |
|
|
|
|
|
|
|
| |
Since the strong cache uses operations in OrderedDict that are not
thread-safe in Python 2, it is necessary to acquire a lock while
updating the dictionary.
When Python 2 support is dropped, we can likely refactor this to avoid
locking.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
test_tzlocal_offset_equal[GMT-tzoff1] fails if a system does not
have a defined (installed) GMT timezone, for example if "Link Etc/GMT GMT"
is not defined in the zoneinfo configuration:
> assert tz.tzlocal() == tzoff
E AssertionError: assert tzlocal() == tzoffset(u'GMT', 0)
E -tzlocal()
E +tzoffset(u'GMT', 0)
An example of such a configuration is FreeBSD, who's default timezone is
UTC [1][2]. This configuration results in any "non-present" or undefined TZ
name being returned/processed as the default timezone name (in FreeBSD's
case, UTC).
Further, POSIX does not recognize [3] TZ=GMT or TZ=UTC as valid values
because they neither start with a colon nor contain a numeric offset hour
field.
Accordingly, update the GMT value for this parametrized test to GMT0, a
specific (not aliased) timezone, making it more robust to system
configuration differences.
[1] https://svnweb.freebsd.org/changeset/base/130332
[2] https://svnweb.freebsd.org/changeset/base/199405
[3] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html
|
| |
|
|
|
|
| |
At the moment these tests are skipped ad-hoc in the test suite, but we
can use `pytest.skip` in the context manager itself to skip them
automatically and make things easier on ourselves.
|
| |\
| |
| | |
Fix error message for gettz when passed bytes
|
| | | |
|
| | |
| |
| |
| | |
Fixes #927
|
| |/
|
|
|
|
| |
This was originally added when we were still supporting unittest-only
tests, but now that we require pytest, we can switch over to using the
built-in pytest.warns context manager.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
It turns out that the import of `contextlib.nullcontext` in Python 3.7+
was accidentally trying to import `contextmanager.nullcontext`, but this
was never noticed because it simply fell back to the backport included
here.
I do not know of a great way to test this that doesn't rely on
implementation details, but I have manually tested it by setting a
breakpoint after the import in the `try` statement and importing
`dateutil.tz` manually on Python 3.7, so this version should work.
|
| | |
|
| |
|
| |
Changed compatibility logic to support a potential Python 4.0 release.
|
| |
|
|
|
| |
Fixes several misspellings, typos and styling errors (e.g. github ->
GitHub) in the comments and documentation.
|
| | |
|
| | |
|
| | |
|