Skip to content

Commit

Permalink
Move export-checking code in hypothesis.strategies into a function
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalathar committed May 20, 2021
1 parent 9e82dee commit e5589b6
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions hypothesis-python/src/hypothesis/strategies/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,15 @@
"SearchStrategy",
]

assert set(_strategies).issubset(__all__), (
set(_strategies) - set(__all__),
set(__all__) - set(_strategies),
)
_public = {n for n in dir() if n[0] not in "_@"}
assert set(__all__) == _public, (set(__all__) - _public, _public - set(__all__))
del _public

def _check_exports(_public):
assert set(_strategies).issubset(__all__), (
set(_strategies) - set(__all__),
set(__all__) - set(_strategies),
)

assert set(__all__) == _public, (set(__all__) - _public, _public - set(__all__))


_check_exports({n for n in dir() if n[0] not in "_@"})
del _check_exports

0 comments on commit e5589b6

Please sign in to comment.