Skip to content

Commit 3ffecc1

Browse files
committed
Doc light-theme vars
1 parent 1e543f2 commit 3ffecc1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

hypothesis-python/src/hypothesis/extra/ghostwriter.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@
5353
-e, --except OBJ_NAME dotted name of exception(s) to ignore
5454
-h, --help Show this message and exit.
5555
56+
.. tip::
57+
58+
Using a light theme? Hypothesis respects `NO_COLOR <https://no-color.org/>`__
59+
and :envvar:`DJANGO_COLORS=light <django:DJANGO_COLORS>`.
60+
5661
.. note::
5762
5863
The ghostwriter requires :pypi:`black`, but the generated code only

hypothesis-python/src/hypothesis/utils/terminal.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ def guess_background_color():
2323
See also https://stackoverflow.com/questions/2507337/ and
2424
https://unix.stackexchange.com/questions/245378/
2525
"""
26+
django_colors = os.getenv("DJANGO_COLORS")
27+
if django_colors in ("light", "dark"):
28+
return django_colors
2629
# Guessing based on the $COLORFGBG environment variable
2730
try:
2831
fg, *_, bg = os.getenv("COLORFGBG").split(";")

0 commit comments

Comments
 (0)