File: test_functions.py

package info (click to toggle)
pytest-mpl 0.17.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,132 kB
  • sloc: python: 2,514; javascript: 179; makefile: 16
file content (80 lines) | stat: -rw-r--r-- 2,014 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import pytest

from .helpers import plot

# ### Test all permutations of:
# baseline hash: match, diff, or missing
# baseline image: match, diff, or missing


# hash match

@pytest.mark.image
@pytest.mark.hash
@pytest.mark.mpl_image_compare(savefig_kwargs={'metadata': {'Software': None}})
def test_hmatch_imatch():
    return plot([1, 2, 3, 4])


@pytest.mark.image
@pytest.mark.mpl_image_compare(savefig_kwargs={'metadata': {'Software': None}})
def test_hmatch_idiff():
    return plot([1, 3, 2, 4])


@pytest.mark.image
@pytest.mark.mpl_image_compare(savefig_kwargs={'metadata': {'Software': None}})
def test_hmatch_idiffshape():
    return plot([4, 2, 3, 1, 2])


@pytest.mark.image
@pytest.mark.mpl_image_compare(savefig_kwargs={'metadata': {'Software': None}})
def test_hmatch_imissing():
    return plot([4, 3, 2, 1])


# hash diff

@pytest.mark.hash
@pytest.mark.mpl_image_compare(savefig_kwargs={'metadata': {'Software': None}})
def test_hdiff_imatch():
    return plot([1, 4, 2, 3])


@pytest.mark.mpl_image_compare(savefig_kwargs={'metadata': {'Software': None}})
def test_hdiff_idiff():
    return plot([1, 2, 4, 3])


@pytest.mark.mpl_image_compare(savefig_kwargs={'metadata': {'Software': None}})
def test_hdiff_idiffshape():
    return plot([4, 2, 3, 1, 3])


@pytest.mark.mpl_image_compare(savefig_kwargs={'metadata': {'Software': None}})
def test_hdiff_imissing():
    return plot([3, 2, 4, 1])


# hash missing

@pytest.mark.hash
@pytest.mark.mpl_image_compare(savefig_kwargs={'metadata': {'Software': None}})
def test_hmissing_imatch():
    return plot([1, 3, 4, 2])


@pytest.mark.mpl_image_compare(savefig_kwargs={'metadata': {'Software': None}})
def test_hmissing_idiff():
    return plot([1, 4, 3, 2])


@pytest.mark.mpl_image_compare(savefig_kwargs={'metadata': {'Software': None}})
def test_hmissing_idiffshape():
    return plot([4, 2, 3, 1, 4])


@pytest.mark.mpl_image_compare(savefig_kwargs={'metadata': {'Software': None}})
def test_hmissing_imissing():
    return plot([2, 4, 3, 1])