|
38 | 38 |
|
39 | 39 | check_cpu_2028_target = importlib.import_module("check_cpu_2028_target") |
40 | 40 |
|
| 41 | +given: Any |
| 42 | +settings: Any |
| 43 | +HealthCheck: Any |
| 44 | +st: Any |
| 45 | + |
41 | 46 | try: |
42 | | - from hypothesis import HealthCheck, given, settings |
43 | | - from hypothesis import strategies as st |
| 47 | + from hypothesis import HealthCheck as _HypothesisHealthCheck |
| 48 | + from hypothesis import given as _hypothesis_given |
| 49 | + from hypothesis import settings as _hypothesis_settings |
| 50 | + from hypothesis import strategies as _hypothesis_st |
44 | 51 |
|
45 | 52 | HYPOTHESIS_AVAILABLE = True |
| 53 | + given = _hypothesis_given |
| 54 | + settings = _hypothesis_settings |
| 55 | + HealthCheck = _HypothesisHealthCheck |
| 56 | + st = _hypothesis_st |
46 | 57 | except ImportError: # pragma: no cover - skip when hypothesis is absent |
47 | 58 | HYPOTHESIS_AVAILABLE = False |
48 | 59 |
|
@@ -70,18 +81,20 @@ def characters(self, *_args: object, **_kwargs: object) -> _MissingStrategy: |
70 | 81 | def integers(self, *_args: object, **_kwargs: object) -> _MissingStrategy: |
71 | 82 | return _MissingStrategy() |
72 | 83 |
|
73 | | - def given(*_args: object, **_kwargs: object): |
74 | | - def decorator(fn): |
| 84 | + def _missing_given(*_args: object, **_kwargs: object): |
| 85 | + def decorator(fn: Any) -> Any: |
75 | 86 | return fn |
76 | 87 |
|
77 | 88 | return decorator |
78 | 89 |
|
79 | | - def settings(*_args: object, **_kwargs: object): |
80 | | - def decorator(fn): |
| 90 | + def _missing_settings(*_args: object, **_kwargs: object): |
| 91 | + def decorator(fn: Any) -> Any: |
81 | 92 | return fn |
82 | 93 |
|
83 | 94 | return decorator |
84 | 95 |
|
| 96 | + given = _missing_given |
| 97 | + settings = _missing_settings |
85 | 98 | HealthCheck = _MissingHealthCheck |
86 | 99 | st = _MissingStrategies() |
87 | 100 |
|
|
0 commit comments