Skip to content

Commit

Permalink
Add comment and tweak changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Sep 2, 2023
1 parent a7f0e19 commit b226695
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hypothesis-python/RELEASE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ RELEASE_TYPE: patch

Add a health check that detects if the same test is executed
several times by :ref:`different executors<custom-function-execution>`.
This can lead to various difficult-to-debug problems.
This can lead to difficult-to-debug problems such as :issue:`3446`.
1 change: 1 addition & 0 deletions hypothesis-python/src/hypothesis/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,7 @@ def wrapped_test(*arguments, **kwargs):
)
if settings.database is not None:
nonlocal prev_self
# Check selfy really is self (not e.g. a mock) before we health-check
cur_self = (
stuff.selfy
if getattr(type(stuff.selfy), test.__name__, None) is wrapped_test
Expand Down
2 changes: 1 addition & 1 deletion hypothesis-python/src/hypothesis/internal/reflection.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def function_digest(function):
# If we can't actually get the source code, try for the name as a fallback.
# NOTE: We might want to change this to always adding function.__qualname__,
# to differentiate f.x. two classes having the same function implementation
# with class-dependend behaviour.
# with class-dependent behaviour.
try:
hasher.update(function.__name__.encode())
except AttributeError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@


class SomeStuff:
@settings(suppress_health_check=[HealthCheck.too_slow])
@settings(
suppress_health_check=[HealthCheck.too_slow, HealthCheck.differing_executors]
)
@given(integers())
def test_is_blank_slate(self, unused):
Company.objects.create(name="MickeyCo")
Expand Down

0 comments on commit b226695

Please sign in to comment.