Skip to content

Commit 7f210c1

Browse files
authored
Merge pull request #3362 from gmacon/timezone-strategy-cross-reference
Reference timezone strategies from datetimes docstring
2 parents b4e8a08 + 34334c0 commit 7f210c1

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ their individual contributions.
5656
* `Florian Bruhin <https://www.github.com/The-Compiler>`_
5757
* `follower <https://www.github.com/follower>`_
5858
* `Gary Donovan <https://www.github.com/garyd203>`_
59+
* `George Macon <https://www.github.com/gmacon>`_
5960
* `Glenn Lehman <https://www.github.com/glnnlhmn>`_
6061
* `Graham Williamson <https://github.com/00willo>`_
6162
* `Grant David Bachman <https://github.com/grantbachman>`_ ([email protected])

hypothesis-python/RELEASE.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
RELEASE_TYPE: patch
2+
3+
Mention :func:`hypothesis.strategies.timezones`
4+
in the documentation of :func:`hypothesis.strategies.datetimes` for completeness.
5+
6+
Thanks to George Macon for this addition.

hypothesis-python/src/hypothesis/strategies/_internal/datetime.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,14 @@ def datetimes(
186186
187187
``timezones`` must be a strategy that generates either ``None``, for naive
188188
datetimes, or :class:`~python:datetime.tzinfo` objects for 'aware' datetimes.
189-
You can construct your own, though we recommend using the :pypi:`dateutil
190-
<python-dateutil>` package and :func:`hypothesis.extra.dateutil.timezones`
191-
strategy, and also provide :func:`hypothesis.extra.pytz.timezones`.
189+
You can construct your own, though we recommend using one of these built-in
190+
strategies:
191+
192+
* with Python 3.9 or newer or :pypi:`backports.zoneinfo`:
193+
:func:`hypothesis.strategies.timezones`;
194+
* with :pypi:`dateutil <python-dateutil>`:
195+
:func:`hypothesis.extra.dateutil.timezones`; or
196+
* with :pypi:`pytz`: :func:`hypothesis.extra.pytz.timezones`.
192197
193198
You may pass ``allow_imaginary=False`` to filter out "imaginary" datetimes
194199
which did not (or will not) occur due to daylight savings, leap seconds,

0 commit comments

Comments
 (0)