File: nodeid.py

package info (click to toggle)
pytest-dependency 0.5.1-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 464 kB
  • sloc: python: 1,542; makefile: 66; sh: 8
file content (26 lines) | stat: -rw-r--r-- 552 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import random
import pytest

def test_a():
    pass

@pytest.mark.parametrize("i,b", [
    (7, True),
    (0, False),
    pytest.param(-1, False, marks=pytest.mark.xfail(reason="nonsense"))
])
def test_b(i, b):
    assert bool(i) == b

ordered = list(range(10))
unordered = random.sample(ordered, k=len(ordered))

class TestClass:

    def test_c(self):
        pass

    @pytest.mark.parametrize("l,ll", [(ordered, 10), (unordered, 10)],
                             ids=["order", "disorder"])
    def test_d(self, l, ll):
        assert len(l) == ll