approval-utilities 11.2.1__tar.gz → 12.0.0__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-11.2.1/approval_utilities.egg-info → approval_utilities-12.0.0}/PKG-INFO +1 -1
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/README.md +1 -1
- {approval_utilities-11.2.1 → approval_utilities-12.0.0/approval_utilities.egg-info}/PKG-INFO +1 -1
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/tests/test_inline_approvals.py +6 -30
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/tests/test_parse_inputs.py +28 -0
- approval_utilities-12.0.0/version.py +1 -0
- approval_utilities-11.2.1/version.py +0 -1
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/LICENSE +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/MANIFEST.in +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/__init__.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/approvaltests/__init__.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/approvaltests/core/__init__.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/approvaltests/core/executable_command.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/approvaltests/core/verifiable.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/approvaltests/core/verify_parameters.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/list_utils.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/__init__.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/clipboard_utilities.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/deprecated.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/exceptions/__init__.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/exceptions/exception_collector.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/exceptions/exception_utils.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/exceptions/multiple_exceptions.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/logger/__init__.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/logger/logging_instance.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/logger/simple_logger.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/map_reduce.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/markdown_table.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/multiline_string_utils.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/os_utilities.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/persistence/__init__.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/persistence/loader.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/persistence/saver.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/stack_frame_utilities.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/string_wrapper.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/time_utilities.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/wrapper.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utils.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities.egg-info/SOURCES.txt +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities.egg-info/dependency_links.txt +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities.egg-info/top_level.txt +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/requirements.prod.extras.txt +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/requirements.prod.required.txt +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/requirements.prod.txt +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/setup.cfg +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/setup.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/setup_utils.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/tests/test_asserts.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/tests/test_combinations.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/tests/test_custom_printers.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/tests/test_example_numpy.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/tests/test_exception_utils.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/tests/test_fileapprover.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/tests/test_list.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/tests/test_multiline_string_utils.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/tests/test_namer.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/tests/test_options.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/tests/test_pairwise_combinations.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/tests/test_python_patterns.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/tests/test_scenarios.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/tests/test_simple_logger.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/tests/test_split_code.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/tests/test_verify.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/tests/test_verify_all.py +0 -0
- {approval_utilities-11.2.1 → approval_utilities-12.0.0}/tests/test_writer.py +0 -0
|
@@ -50,7 +50,7 @@ utilities.
|
|
|
50
50
|
|
|
51
51
|
### What Are Approvals
|
|
52
52
|
|
|
53
|
-
If you need to gain a better understanding or are new to this concept, start [here](
|
|
53
|
+
If you need to gain a better understanding or are new to this concept, start [here](https://github.com/approvals/ApprovalTests.Documentation/blob/main/explanations/what_are_approvals.md).
|
|
54
54
|
|
|
55
55
|
### New Projects
|
|
56
56
|
|
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
import unittest
|
|
2
2
|
from inspect import FrameInfo
|
|
3
|
-
from pathlib import Path
|
|
4
3
|
from typing import Callable, Any
|
|
5
4
|
|
|
6
5
|
import pytest
|
|
7
6
|
|
|
8
|
-
from approval_utilities.utilities.clipboard_utilities import copy_to_clipboard
|
|
9
7
|
from approval_utilities.utilities.multiline_string_utils import remove_indentation_from
|
|
10
8
|
from approvaltests import (
|
|
11
9
|
StackFrameNamer,
|
|
12
|
-
assert_equal_with_reporter,
|
|
13
10
|
Options,
|
|
14
|
-
Reporter,
|
|
15
11
|
verify,
|
|
16
12
|
verify_all,
|
|
17
13
|
verify_all_combinations_with_labeled_input,
|
|
18
14
|
ApprovalException,
|
|
19
15
|
)
|
|
16
|
+
from approvaltests.inline.inline_options import InlineOptions
|
|
20
17
|
from approvaltests.inline.parse_docstring import parse_docstring
|
|
21
|
-
from approvaltests.reporters import MultiReporter, ReportWithBeyondCompare
|
|
22
18
|
from approvaltests.reporters.report_quietly import ReportQuietly
|
|
23
19
|
|
|
24
20
|
|
|
@@ -76,30 +72,13 @@ def test_docstrings():
|
|
|
76
72
|
"""
|
|
77
73
|
# verify_inline(greetting())
|
|
78
74
|
# verify(greetting(), options=Options().inline(show_code= False))
|
|
79
|
-
verify(greeting(), options=Options().inline(
|
|
75
|
+
verify(greeting(), options=Options().inline())
|
|
80
76
|
|
|
81
77
|
|
|
82
78
|
def greeting():
|
|
83
79
|
return "hello\nworld"
|
|
84
80
|
|
|
85
81
|
|
|
86
|
-
class InlineReporter(Reporter):
|
|
87
|
-
# TODO: Start here - Make this report create a temp file of the fixed source,
|
|
88
|
-
# and compare it with the existing source.
|
|
89
|
-
# if there are mulitple failures, they each get there on reporter
|
|
90
|
-
def report(self, received_path: str, approved_path: str) -> bool:
|
|
91
|
-
received = Path(received_path).read_text()
|
|
92
|
-
copy_to_clipboard(f"'''\n{received}\n'''")
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
def verify_inline(actual):
|
|
96
|
-
options = Options()
|
|
97
|
-
options = options.with_reporter(MultiReporter(options.reporter, InlineReporter()))
|
|
98
|
-
if actual[-1] != "\n":
|
|
99
|
-
actual += "\n"
|
|
100
|
-
assert_equal_with_reporter(get_approved_via_doc_string(), actual, options=options)
|
|
101
|
-
|
|
102
|
-
|
|
103
82
|
def test_docstring_parsing():
|
|
104
83
|
"""
|
|
105
84
|
1
|
|
@@ -157,7 +136,7 @@ class InlineTests(unittest.TestCase):
|
|
|
157
136
|
lambda a, b: a + b,
|
|
158
137
|
arg1=(1, 3),
|
|
159
138
|
arg2=(2, 4),
|
|
160
|
-
options=Options().inline(
|
|
139
|
+
options=Options().inline(),
|
|
161
140
|
)
|
|
162
141
|
|
|
163
142
|
|
|
@@ -170,7 +149,7 @@ def test_preceding_whitespace():
|
|
|
170
149
|
"""
|
|
171
150
|
4 whitespaces
|
|
172
151
|
"""
|
|
173
|
-
verify(get_preceding_whitespace(), options=Options().inline(
|
|
152
|
+
verify(get_preceding_whitespace(), options=Options().inline())
|
|
174
153
|
|
|
175
154
|
|
|
176
155
|
def test_trailing_whitespace():
|
|
@@ -179,7 +158,7 @@ def test_trailing_whitespace():
|
|
|
179
158
|
"""
|
|
180
159
|
# Note: Pycharm will remove the trailing whitespaces, to disable this go to:
|
|
181
160
|
# File -> Settings -> Editor -> General -> On Save -> [ ] Remove trailing spaces
|
|
182
|
-
verify("4 trailing whitespaces ", options=Options().inline(
|
|
161
|
+
verify("4 trailing whitespaces ", options=Options().inline())
|
|
183
162
|
|
|
184
163
|
# fmt: on
|
|
185
164
|
|
|
@@ -193,7 +172,4 @@ def test_bug_blank_lines():
|
|
|
193
172
|
|
|
194
173
|
|
|
195
174
|
"""
|
|
196
|
-
verify(
|
|
197
|
-
"\n\ntest bug with blank lines\n\n\n\n",
|
|
198
|
-
options=Options().inline(show_code=True),
|
|
199
|
-
)
|
|
175
|
+
verify("\n\ntest bug with blank lines\n\n\n\n", options=Options().inline())
|
|
@@ -115,3 +115,31 @@ def test_with_two_parameters():
|
|
|
115
115
|
|
|
116
116
|
|
|
117
117
|
# end-snippet
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
# long-term intention: get the test to fail, randomSauce is incorrect
|
|
121
|
+
def test_with_3_parameters():
|
|
122
|
+
"""
|
|
123
|
+
a, 3, 1 -> aaaa
|
|
124
|
+
"""
|
|
125
|
+
|
|
126
|
+
counter = 0
|
|
127
|
+
|
|
128
|
+
def to(tin: type, tout: type):
|
|
129
|
+
def wrapped(input):
|
|
130
|
+
nonlocal counter
|
|
131
|
+
counter += 1
|
|
132
|
+
assert type(input) is tin
|
|
133
|
+
return tout(input)
|
|
134
|
+
|
|
135
|
+
return wrapped
|
|
136
|
+
|
|
137
|
+
parse = Parse.doc_string(auto_approve=True)
|
|
138
|
+
parse.transform3(to(str, str), to(str, str), to(str, str)).transform3(
|
|
139
|
+
to(str, str), to(str, int), to(str, int)
|
|
140
|
+
).verify_all(lambda a, b, c: to(str, str)(a) * (to(int, int)(b) + to(int, int)(c)))
|
|
141
|
+
|
|
142
|
+
assert counter == 9
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
# assert on all the paramaters
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
version_number = "v12.0.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
version_number = "v11.2.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/approvaltests/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{approval_utilities-11.2.1 → approval_utilities-12.0.0}/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-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/map_reduce.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{approval_utilities-11.2.1 → approval_utilities-12.0.0}/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-11.2.1 → approval_utilities-12.0.0}/approval_utilities/utilities/wrapper.py
RENAMED
|
File without changes
|
|
File without changes
|
{approval_utilities-11.2.1 → approval_utilities-12.0.0}/approval_utilities.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{approval_utilities-11.2.1 → approval_utilities-12.0.0}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{approval_utilities-11.2.1 → approval_utilities-12.0.0}/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
|