|
16 | 16 | def test_not_version_regex():
|
17 | 17 | counter = 1
|
18 | 18 |
|
19 |
| - for comment_string in ["#", "# ", "# ", "#\t", "# \t", "# \t ", "#\t "]: |
| 19 | + for comment_string in ['#', "# ", "# ", "#\t", "# \t", "# \t ", "#\t "]: |
20 | 20 | for pragma_string in ["pragma", "PRAGMA"]:
|
21 | 21 | for post_pragma_space in ['', ':', ": ", ":\t", " "]:
|
22 | 22 | for no_string in ["no", "NO"]:
|
23 |
| - for post_no_space in ['', " ", "\t", " "]: |
| 23 | + for post_no_space in ['', ' ', "\t", " "]: |
24 | 24 | for cover_string in ["cover", "COVER"]:
|
25 |
| - for post_cover_space in ['', " ", "\t", " "]: |
26 |
| - for pre_version_sign in [">", "<", ">=", "<=", ""]: |
| 25 | + for post_cover_space in ['', ' ', "\t", " "]: |
| 26 | + for pre_version_sign in ['>', '<', ">=", "<=", '']: |
27 | 27 | for py_string in ["Py", "PY", "py"]:
|
28 | 28 | for version in [30, 31, 32, 33, 34, 35, 36, 37, 38, 39]:
|
29 |
| - for post_version_sign in ["+", ""]: |
| 29 | + for post_version_sign in ['+', '']: |
30 | 30 | test_string = f"{comment_string}{pragma_string}{post_pragma_space}{no_string}{post_no_space}{cover_string}{post_cover_space}({pre_version_sign}{py_string}{version}{post_version_sign})"
|
31 | 31 | # print(f"[{counter} TESTING: {test_string}]")
|
32 | 32 |
|
33 | 33 | if re.match(not_version_regex, test_string):
|
34 | 34 | raise AssertionError(f"[{counter} FAIL: {test_string}]")
|
35 | 35 | counter += 1
|
36 | 36 |
|
37 |
| - for comment_string in ["#", "# ", "# ", "#\t", "# \t", "# \t ", "#\t "]: |
| 37 | + for comment_string in ['#', "# ", "# ", "#\t", "# \t", "# \t ", "#\t "]: |
38 | 38 | for pragma_string in ["pragma", "PRAGMA"]:
|
39 | 39 | for post_pragma_space in ['', ':', ": ", ":\t", " "]:
|
40 | 40 | for no_string in ["no", "NO"]:
|
41 |
| - for post_no_space in ['', " ", "\t", " "]: |
| 41 | + for post_no_space in ['', ' ', "\t", " "]: |
42 | 42 | for cover_string in ["cover", "COVER"]:
|
43 |
| - for post_cover_space in ['', " ", "\t", " "]: |
44 |
| - for post_cover_text in ["", "abcdefg", "hello world"]: |
| 43 | + for post_cover_space in ['', ' ', "\t", " "]: |
| 44 | + for post_cover_text in ['', "abcdefg", "hello world"]: |
45 | 45 | test_string = f"{comment_string}{pragma_string}{post_pragma_space}{no_string}{post_no_space}{cover_string}{post_cover_space}{post_cover_text}"
|
46 | 46 | # print(f"[{counter} TESTING: {test_string}]")
|
47 | 47 |
|
@@ -83,21 +83,21 @@ def test_correct_version_regex():
|
83 | 83 |
|
84 | 84 | # TODO: Plus
|
85 | 85 | for pre_version_sign, minor_versions in zip(
|
86 |
| - [">", "<", ">=", "<=", ""], |
| 86 | + ['>', '<', ">=", "<=", ''], |
87 | 87 | [range(0, python_version.minor), range(python_version.minor + 1, 10), range(0, python_version.minor + 1), range(python_version.minor, 10), [python_version.minor], [python_version.minor]]
|
88 | 88 | ):
|
89 | 89 | for minor_version in minor_versions:
|
90 | 90 | version = 30 + minor_version
|
91 | 91 |
|
92 |
| - for comment_string in ["#", "# ", "# ", "#\t", "# \t", "# \t ", "#\t "]: |
| 92 | + for comment_string in ['#', "# ", "# ", "#\t", "# \t", "# \t ", "#\t "]: |
93 | 93 | for pragma_string in ["pragma", "PRAGMA"]:
|
94 | 94 | for post_pragma_space in ['', ':', ": ", ":\t", " "]:
|
95 | 95 | for no_string in ["no", "NO"]:
|
96 |
| - for post_no_space in ['', " ", "\t", " "]: |
| 96 | + for post_no_space in ['', ' ', '\t', " "]: |
97 | 97 | for cover_string in ["cover", "COVER"]:
|
98 |
| - for post_cover_space in ['', " ", "\t", " "]: |
| 98 | + for post_cover_space in ['', ' ', '\t', " "]: |
99 | 99 | for py_string in ["Py", "PY", "py"]:
|
100 |
| - # for post_version_sign in ["+", ""]: |
| 100 | + # for post_version_sign in ['+', '']: |
101 | 101 |
|
102 | 102 | test_string = f"{comment_string}{pragma_string}{post_pragma_space}{no_string}{post_no_space}{cover_string}{post_cover_space}({pre_version_sign}{py_string}{version}{post_version_sign})" # print(f"[{counter} TESTING: {test_string}]")
|
103 | 103 |
|
|
0 commit comments