|
4 | 4 |
|
5 | 5 | try:
|
6 | 6 | from pytest_codspeed import BenchmarkFixture
|
| 7 | + |
7 | 8 | CODSPEED_MISSING = False
|
8 | 9 | except ImportError:
|
9 | 10 | CODSPEED_MISSING = True
|
|
21 | 22 | LONG_QUERY_WITH_PCT = LONG_QUERY + "&d=%25%2F%3F%3A%40%26%3B%3D%2B"
|
22 | 23 |
|
23 | 24 |
|
24 |
| -@pytest.mark.skipif( |
25 |
| - CODSPEED_MISSING, reason="pytest-codspeed needs to be installed" |
26 |
| -) |
| 25 | +@pytest.mark.skipif(CODSPEED_MISSING, reason="pytest-codspeed needs to be installed") |
27 | 26 | def test_quote_query_string(benchmark: BenchmarkFixture) -> None:
|
28 | 27 | @benchmark
|
29 | 28 | def _run() -> None:
|
30 | 29 | for _ in range(100):
|
31 | 30 | QUERY_QUOTER("a=1&b=2&c=3&d=4&e=5&f=6&g=7&h=8&i=9&j=0")
|
32 | 31 |
|
33 | 32 |
|
34 |
| -@pytest.mark.skipif( |
35 |
| - CODSPEED_MISSING, reason="pytest-codspeed needs to be installed" |
36 |
| -) |
| 33 | +@pytest.mark.skipif(CODSPEED_MISSING, reason="pytest-codspeed needs to be installed") |
37 | 34 | def test_quoter_ascii(benchmark: BenchmarkFixture) -> None:
|
38 | 35 | @benchmark
|
39 | 36 | def _run() -> None:
|
40 | 37 | for _ in range(100):
|
41 | 38 | QUOTER_SLASH_SAFE("/path/to")
|
42 | 39 |
|
43 | 40 |
|
44 |
| -@pytest.mark.skipif( |
45 |
| - CODSPEED_MISSING, reason="pytest-codspeed needs to be installed" |
46 |
| -) |
| 41 | +@pytest.mark.skipif(CODSPEED_MISSING, reason="pytest-codspeed needs to be installed") |
47 | 42 | def test_quote_long_path(benchmark: BenchmarkFixture) -> None:
|
48 | 43 | @benchmark
|
49 | 44 | def _run() -> None:
|
50 | 45 | for _ in range(100):
|
51 | 46 | PATH_QUOTER(LONG_PATH)
|
52 | 47 |
|
53 | 48 |
|
54 |
| -@pytest.mark.skipif( |
55 |
| - CODSPEED_MISSING, reason="pytest-codspeed needs to be installed" |
56 |
| -) |
| 49 | +@pytest.mark.skipif(CODSPEED_MISSING, reason="pytest-codspeed needs to be installed") |
57 | 50 | def test_quoter_pct(benchmark: BenchmarkFixture) -> None:
|
58 | 51 | @benchmark
|
59 | 52 | def _run() -> None:
|
60 | 53 | for _ in range(100):
|
61 | 54 | QUOTER("abc%0a")
|
62 | 55 |
|
63 | 56 |
|
64 |
| -@pytest.mark.skipif( |
65 |
| - CODSPEED_MISSING, reason="pytest-codspeed needs to be installed" |
66 |
| -) |
| 57 | +@pytest.mark.skipif(CODSPEED_MISSING, reason="pytest-codspeed needs to be installed") |
67 | 58 | def test_long_query(benchmark: BenchmarkFixture) -> None:
|
68 | 59 | @benchmark
|
69 | 60 | def _run() -> None:
|
70 | 61 | for _ in range(100):
|
71 | 62 | QUERY_QUOTER(LONG_QUERY)
|
72 | 63 |
|
73 | 64 |
|
74 |
| -@pytest.mark.skipif( |
75 |
| - CODSPEED_MISSING, reason="pytest-codspeed needs to be installed" |
76 |
| -) |
| 65 | +@pytest.mark.skipif(CODSPEED_MISSING, reason="pytest-codspeed needs to be installed") |
77 | 66 | def test_long_query_with_pct(benchmark: BenchmarkFixture) -> None:
|
78 | 67 | @benchmark
|
79 | 68 | def _run() -> None:
|
80 | 69 | for _ in range(100):
|
81 | 70 | QUERY_QUOTER(LONG_QUERY_WITH_PCT)
|
82 | 71 |
|
83 | 72 |
|
84 |
| -@pytest.mark.skipif( |
85 |
| - CODSPEED_MISSING, reason="pytest-codspeed needs to be installed" |
86 |
| -) |
| 73 | +@pytest.mark.skipif(CODSPEED_MISSING, reason="pytest-codspeed needs to be installed") |
87 | 74 | def test_quoter_quote_utf8(benchmark: BenchmarkFixture) -> None:
|
88 | 75 | @benchmark
|
89 | 76 | def _run() -> None:
|
90 | 77 | for _ in range(100):
|
91 | 78 | PATH_QUOTER("/шлях/файл")
|
92 | 79 |
|
93 | 80 |
|
94 |
| -@pytest.mark.skipif( |
95 |
| - CODSPEED_MISSING, reason="pytest-codspeed needs to be installed" |
96 |
| -) |
| 81 | +@pytest.mark.skipif(CODSPEED_MISSING, reason="pytest-codspeed needs to be installed") |
97 | 82 | def test_unquoter_short(benchmark: BenchmarkFixture) -> None:
|
98 | 83 | @benchmark
|
99 | 84 | def _run() -> None:
|
100 | 85 | for _ in range(100):
|
101 | 86 | UNQUOTER("/path/to")
|
102 | 87 |
|
103 | 88 |
|
104 |
| -@pytest.mark.skipif( |
105 |
| - CODSPEED_MISSING, reason="pytest-codspeed needs to be installed" |
106 |
| -) |
| 89 | +@pytest.mark.skipif(CODSPEED_MISSING, reason="pytest-codspeed needs to be installed") |
107 | 90 | def test_unquoter_long_ascii(benchmark: BenchmarkFixture) -> None:
|
108 | 91 | @benchmark
|
109 | 92 | def _run() -> None:
|
110 | 93 | for _ in range(100):
|
111 | 94 | UNQUOTER(LONG_QUERY)
|
112 | 95 |
|
113 | 96 |
|
114 |
| -@pytest.mark.skipif( |
115 |
| - CODSPEED_MISSING, reason="pytest-codspeed needs to be installed" |
116 |
| -) |
| 97 | +@pytest.mark.skipif(CODSPEED_MISSING, reason="pytest-codspeed needs to be installed") |
117 | 98 | def test_unquoter_long_pct(benchmark: BenchmarkFixture) -> None:
|
118 | 99 | @benchmark
|
119 | 100 | def _run() -> None:
|
|
0 commit comments