]> git.pld-linux.org Git - packages/python3-tinycss2.git/blob - disable-missing-data-tests.patch
- new
[packages/python3-tinycss2.git] / disable-missing-data-tests.patch
1 --- tinycss2-1.1.0/tests/test_tinycss2.py~      2020-10-08 09:28:34.000000000 +0200
2 +++ tinycss2-1.1.0/tests/test_tinycss2.py       2021-09-05 23:24:47.645579634 +0200
3 @@ -80,99 +80,9 @@
4      return list(zip(json_data[::2], json_data[1::2]))
5  
6  
7 -def json_test(filename=None):
8 -    def decorator(function):
9 -        filename_ = filename or function.__name__.split('_', 1)[-1] + '.json'
10 -
11 -        @pytest.mark.parametrize(('css', 'expected'), load_json(filename_))
12 -        def test(css, expected):
13 -            value = to_json(function(css))
14 -            if value != expected:  # pragma: no cover
15 -                pprint.pprint(value)
16 -                assert value == expected
17 -        return test
18 -    return decorator
19 -
20 -
21  SKIP = dict(skip_comments=True, skip_whitespace=True)
22  
23  
24 -@json_test()
25 -def test_component_value_list(input):
26 -    return parse_component_value_list(input, skip_comments=True)
27 -
28 -
29 -@json_test()
30 -def test_one_component_value(input):
31 -    return parse_one_component_value(input, skip_comments=True)
32 -
33 -
34 -@json_test()
35 -def test_declaration_list(input):
36 -    return parse_declaration_list(input, **SKIP)
37 -
38 -
39 -@json_test()
40 -def test_one_declaration(input):
41 -    return parse_one_declaration(input, skip_comments=True)
42 -
43 -
44 -@json_test()
45 -def test_stylesheet(input):
46 -    return parse_stylesheet(input, **SKIP)
47 -
48 -
49 -@json_test()
50 -def test_rule_list(input):
51 -    return parse_rule_list(input, **SKIP)
52 -
53 -
54 -@json_test()
55 -def test_one_rule(input):
56 -    return parse_one_rule(input, skip_comments=True)
57 -
58 -
59 -@json_test()
60 -def test_color3(input):
61 -    return parse_color(input)
62 -
63 -
64 -@json_test(filename='An+B.json')
65 -def test_nth(input):
66 -    return parse_nth(input)
67 -
68 -
69 -# Do not use @pytest.mark.parametrize because it is slow with that many values.
70 -def test_color3_hsl():
71 -    for css, expected in load_json('color3_hsl.json'):
72 -        assert to_json(parse_color(css)) == expected
73 -
74 -
75 -def test_color3_keywords():
76 -    for css, expected in load_json('color3_keywords.json'):
77 -        result = parse_color(css)
78 -        if result is not None:
79 -            r, g, b, a = result
80 -            result = [r * 255, g * 255, b * 255, a]
81 -        assert result == expected
82 -
83 -
84 -@json_test()
85 -def test_stylesheet_bytes(kwargs):
86 -    kwargs['css_bytes'] = kwargs['css_bytes'].encode('latin1')
87 -    kwargs.pop('comment', None)
88 -    if kwargs.get('environment_encoding'):
89 -        kwargs['environment_encoding'] = lookup(kwargs['environment_encoding'])
90 -    kwargs.update(SKIP)
91 -    return parse_stylesheet_bytes(**kwargs)
92 -
93 -
94 -@json_test(filename='component_value_list.json')
95 -def test_serialization(css):
96 -    parsed = parse_component_value_list(css, skip_comments=True)
97 -    return parse_component_value_list(serialize(parsed), skip_comments=True)
98 -
99 -
100  def test_skip():
101      source = '''
102      /* foo */
This page took 0.082358 seconds and 3 git commands to generate.