File: hypothesis.py

package info (click to toggle)
cloud-init 22.4.2-1%2Bdeb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,088 kB
  • sloc: python: 108,898; sh: 4,091; makefile: 147; xml: 22
file content (20 lines) | stat: -rw-r--r-- 441 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
try:
    from hypothesis import given

    HAS_HYPOTHESIS = True
except ImportError:
    HAS_HYPOTHESIS = False

    from unittest import mock

    def given(*_, **__):  # type: ignore
        """Dummy implementation to make pytest collection pass"""

        @mock.Mock  # Add mock to fulfill the expected hypothesis value
        def run_test(item):
            return item

        return run_test


__all__ = ["given", "HAS_HYPOTHESIS"]