File: conftest.py

package info (click to toggle)
sorted-nearest 0.0.39%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 324 kB
  • sloc: python: 215; sh: 20; makefile: 8
file content (17 lines) | stat: -rw-r--r-- 473 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import hypothesis.strategies as st
from hypothesis import given
from hypothesis.extra.pandas import columns, data_frames, range_indexes

positions = st.integers(min_value=0, max_value=int(1e7))


def mysort(pos1, pos2):
    if pos1 > pos2:
        return pos2, pos1
    elif pos2 > pos1:
        return pos1, pos2
    else:
        return pos1, pos2 + 1


dfs = data_frames(columns=columns("Start End".split(), dtype=int), rows=st.tuples(positions, positions).map(mysort))