-
-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathtest_failing_tests.py
More file actions
90 lines (58 loc) · 1.91 KB
/
test_failing_tests.py
File metadata and controls
90 lines (58 loc) · 1.91 KB
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
81
82
83
84
85
86
87
88
89
90
"""
Tests that are expected to fail currently
"""
import ast
import pytest
from python_minifier import UnstableMinification, minify, unparse
@pytest.mark.xfail(reason="Known unstable minification")
def test_unstable_minification():
"""
Known unstable minifications that need to be fixed
"""
with pytest.raises(UnstableMinification):
minify('with (x := await a, y := await b): pass')
@pytest.mark.xfail(reason="Known un-optimal minification")
def test_name_following_literal_number():
"""
Name following literal number without a space
This is a syntax warning in recent versions of Python,
perhaps we should consider making this an optional minification
"""
source = 'True if 0in x else False'
assert source == unparse(ast.parse(source))
@pytest.mark.xfail(reason="Known un-optimal minification")
def test_generator_parentheses():
"""
Generator expression parentheses
Generator expressions are not always required to be parenthesized,
but we currently always parenthesize them
"""
source = 'sum(A for A in A)'
assert source == unparse(ast.parse(source))
@pytest.mark.xfail(reason="Known un-optimal minification")
def test_generator_in_arglist():
"""
Expanding a generator expression in an function call argument list
"""
source = 'A(*[B for b in a])'
assert source == unparse(ast.parse(source))
@pytest.mark.xfail(reason="Known un-optimal minification")
def test_tuple_in_for_target():
"""
A tuple in a for target has unnecessary parentheses
"""
source = 'for A,B in C:pass'
assert source == unparse(ast.parse(source))
@pytest.mark.xfail(reason="Known un-optimal minification")
def test_string_literal_style():
"""
String literals don't choose the smallest quote style
"""
source = '''my_string="""This
is
my
multi-line
string
"""
'''
assert source == unparse(ast.parse(source))