File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 7777
7878
7979def onlyIfHasHypothesis (has_hypothesis ):
80- """Decorator to handle optional loading."""
80+ """
81+ Conditionally enable a class based on the availability of the hypothesis library.
82+
83+ If the provided flag is False, returns a dummy class with a placeholder method that does nothing,
84+ allowing tests dependent on hypothesis to be safely bypassed. If True, the original
85+ class is returned unchanged.
86+
87+ Arguments:
88+ has_hypothesis (bool): Flag indicating whether the hypothesis library is available.
89+
90+ Returns:
91+ callable: A decorator function that returns either the original class or a dummy class
92+ with a placeholder method, depending on the has_hypothesis flag.
93+ """
8194 def decorator (cls ):
8295 if not has_hypothesis :
8396 # Create an empty class with a method that returns None
You can’t perform that action at this time.
0 commit comments