File: addition_op_multimagic.txt

package info (click to toggle)
python-hypothesis 6.67.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 14,220 kB
  • sloc: python: 46,711; ruby: 1,107; sh: 255; xml: 140; makefile: 49; javascript: 12
file content (16 lines) | stat: -rw-r--r-- 624 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# This test code was written by the `hypothesis.extra.ghostwriter` module
# and is provided under the Creative Commons Zero public domain dedication.

import _operator
import numpy
import test_expected_output
from hypothesis import given, strategies as st


@given(a=st.floats(), b=st.floats())
def test_equivalent_add_add_add(a: float, b: float) -> None:
    result_0_add = _operator.add(a, b)
    result_1_add = numpy.add(a, b)
    result_2_add = test_expected_output.add(a=a, b=b)
    assert result_0_add == result_1_add, (result_0_add, result_1_add)
    assert result_0_add == result_2_add, (result_0_add, result_2_add)