approval-utilities 15.1.1__tar.gz → 15.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of approval-utilities might be problematic. Click here for more details.
- {approval_utilities-15.1.1/approval_utilities.egg-info → approval_utilities-15.2.1}/PKG-INFO +1 -1
- {approval_utilities-15.1.1 → approval_utilities-15.2.1/approval_utilities.egg-info}/PKG-INFO +1 -1
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_inline_approvals.py +65 -3
- approval_utilities-15.2.1/version.py +1 -0
- approval_utilities-15.1.1/version.py +0 -1
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/LICENSE +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/MANIFEST.in +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/README.md +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/__init__.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/approvaltests/__init__.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/approvaltests/core/__init__.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/approvaltests/core/executable_command.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/approvaltests/core/verifiable.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/approvaltests/core/verify_parameters.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/list_utils.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/py.typed +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/__init__.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/clipboard_utilities.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/deprecated.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/exceptions/__init__.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/exceptions/exception_collector.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/exceptions/exception_utils.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/exceptions/multiple_exceptions.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/logger/__init__.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/logger/logging_instance.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/logger/simple_logger.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/map_reduce.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/markdown_table.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/multiline_string_utils.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/os_utilities.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/persistence/__init__.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/persistence/loader.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/persistence/saver.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/stack_frame_utilities.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/string_wrapper.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/time_utilities.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/wrapper.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utils.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities.egg-info/SOURCES.txt +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities.egg-info/dependency_links.txt +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities.egg-info/top_level.txt +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/requirements.prod.extras.txt +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/requirements.prod.required.txt +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/requirements.prod.txt +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/setup.cfg +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/setup.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/setup_utils.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_approvaltests_temp_dir.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_asserts.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_build.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_combinations.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_compare_file_lists.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_custom_printers.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_example_numpy.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_exception_utils.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_fileapprover.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_find_stale_approved_files.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_list.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_multiline_string_utils.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_namer.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_options.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_pairwise_combinations.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_parse_inputs.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_python_patterns.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_scenarios.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_simple_logger.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_split_code.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_verify.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_verify_all.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_verify_argument_parser.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_workflow_matrix.py +0 -0
- {approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_writer.py +0 -0
|
@@ -15,8 +15,14 @@ from approvaltests import (
|
|
|
15
15
|
verify_all_combinations_with_labeled_input,
|
|
16
16
|
)
|
|
17
17
|
from approvaltests.inline.inline_options import InlineOptions
|
|
18
|
+
from approvaltests.inline.markers import PRESERVE_LEADING_WHITESPACE_MARKER
|
|
18
19
|
from approvaltests.inline.parse_docstring import parse_docstring
|
|
19
20
|
from approvaltests.namer.inline_comparator import InlineComparator
|
|
21
|
+
from approvaltests.namer.inline_python_reporter import (
|
|
22
|
+
detect_trailing_whitespace,
|
|
23
|
+
escape_backslashes,
|
|
24
|
+
handle_preceeding_whitespace,
|
|
25
|
+
)
|
|
20
26
|
from approvaltests.reporters.report_quietly import ReportQuietly
|
|
21
27
|
from approvaltests.reporters.report_with_beyond_compare import (
|
|
22
28
|
ReportWithBeyondCompare,
|
|
@@ -137,17 +143,34 @@ def get_preceding_whitespace() -> str:
|
|
|
137
143
|
|
|
138
144
|
# fmt: off
|
|
139
145
|
@unittest.skipIf(sys.version_info >= (3, 13), "__doc__ removes preceding whitespace in Python 3.13+")
|
|
146
|
+
def test_preceding_whitespace_before_python_3_13() -> None:
|
|
147
|
+
"""
|
|
148
|
+
4 whitespaces
|
|
149
|
+
"""
|
|
150
|
+
verify(get_preceding_whitespace(), options=Options().inline())
|
|
151
|
+
|
|
140
152
|
def test_preceding_whitespace() -> None:
|
|
141
153
|
"""
|
|
154
|
+
<<approvaltests:preserve-leading-whitespace>>
|
|
142
155
|
4 whitespaces
|
|
143
156
|
"""
|
|
144
157
|
verify(get_preceding_whitespace(), options=Options().inline())
|
|
145
158
|
|
|
146
159
|
|
|
160
|
+
def test_no_preceeding_whitespace() -> None:
|
|
161
|
+
"""
|
|
162
|
+
4 whitespaces
|
|
163
|
+
applesauce
|
|
164
|
+
"""
|
|
165
|
+
text = " 4 whitespaces\napplesauce"
|
|
166
|
+
verify(text, options=Options().inline())
|
|
167
|
+
|
|
168
|
+
|
|
147
169
|
def test_trailing_whitespace() -> None:
|
|
148
170
|
"""
|
|
149
171
|
4 trailing whitespaces
|
|
150
|
-
"""
|
|
172
|
+
""" # Warning: Editors may remove trailing spaces, causing this test to fail
|
|
173
|
+
|
|
151
174
|
# Note: Pycharm will remove the trailing whitespaces, to disable this go to:
|
|
152
175
|
# File -> Settings -> Editor -> General -> On Save -> [ ] Remove trailing spaces
|
|
153
176
|
verify("4 trailing whitespaces ", options=Options().inline())
|
|
@@ -159,12 +182,24 @@ def test_bug_blank_lines() -> None:
|
|
|
159
182
|
"""
|
|
160
183
|
|
|
161
184
|
|
|
162
|
-
test bug with blank lines
|
|
185
|
+
test bug <br \\> with blank lines
|
|
163
186
|
|
|
164
187
|
|
|
165
188
|
|
|
166
189
|
"""
|
|
167
|
-
verify("\n\ntest bug with blank lines\n\n\n\n", options=Options().inline())
|
|
190
|
+
verify("\n\ntest bug <br \\> with blank lines\n\n\n\n", options=Options().inline())
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def test_handle_preceeding_whitespace_all_lines_indented() -> None:
|
|
194
|
+
text = " indented with spaces\n\tindented with tab\n still indented"
|
|
195
|
+
result = handle_preceeding_whitespace(text)
|
|
196
|
+
assert result.startswith(PRESERVE_LEADING_WHITESPACE_MARKER)
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
def test_handle_preceeding_whitespace_one_line_not_indented() -> None:
|
|
200
|
+
text = " indented with spaces\nnot indented\n\tindented with tab"
|
|
201
|
+
result = handle_preceeding_whitespace(text)
|
|
202
|
+
assert not result.startswith(PRESERVE_LEADING_WHITESPACE_MARKER)
|
|
168
203
|
|
|
169
204
|
|
|
170
205
|
def test_inline_with_additional_reporter() -> None:
|
|
@@ -204,3 +239,30 @@ def test_inline_with_semi_automatic_inline() -> None:
|
|
|
204
239
|
except ApprovalException:
|
|
205
240
|
pass
|
|
206
241
|
verify(InlineComparator.get_test_method_doc_string())
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
def test_detect_trailing_whitespace_true() -> None:
|
|
245
|
+
text = "no trail\nwith trail \t\nnormal"
|
|
246
|
+
assert detect_trailing_whitespace(text)
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
def test_detect_trailing_whitespace_false() -> None:
|
|
250
|
+
text = "alpha\nbeta\ngamma"
|
|
251
|
+
assert not detect_trailing_whitespace(text)
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
def test_detect_trailing_whitespace_ignores_pure_empty_lines() -> None:
|
|
255
|
+
text = "line1\n\nline2"
|
|
256
|
+
assert not detect_trailing_whitespace(text)
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
def test_escape_backslashes_windows_path() -> None:
|
|
260
|
+
text = "C:\\Temp\\foo\\bar\\note.txt"
|
|
261
|
+
assert escape_backslashes(text) == "C:\\Temp\\foo\\bar\\note.txt".replace(
|
|
262
|
+
"\\", "\\\\"
|
|
263
|
+
)
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
def test_escape_backslashes_mixed_sequences() -> None:
|
|
267
|
+
text = "a\\b\\c\\n"
|
|
268
|
+
assert escape_backslashes(text) == "a\\b\\c\\n".replace("\\", "\\\\")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
version_number = "v15.2.1"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
version_number = "v15.1.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/approvaltests/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/deprecated.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/map_reduce.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/os_utilities.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities/utilities/wrapper.py
RENAMED
|
File without changes
|
|
File without changes
|
{approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{approval_utilities-15.1.1 → approval_utilities-15.2.1}/approval_utilities.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_approvaltests_temp_dir.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_find_stale_approved_files.py
RENAMED
|
File without changes
|
|
File without changes
|
{approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_multiline_string_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{approval_utilities-15.1.1 → approval_utilities-15.2.1}/tests/test_verify_argument_parser.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|