Skip to content

Commit

Permalink
- F inline: default to show code
Browse files Browse the repository at this point in the history
Co-Authored-By: Nitsan Avni <nitsanav@gmail.com>
Co-Authored-By: 4dsherwood <4dsherwood@users.noreply.github.com>
  • Loading branch information
3 people committed Apr 28, 2024
1 parent 6f9dc65 commit 4bd9045
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 44 deletions.
2 changes: 1 addition & 1 deletion approvaltests/core/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ def namer(self) -> Namer:

def inline(self, inline_options: InlineOptions = None) -> "Options":
from approvaltests.namer.inline_comparator import InlineComparator
print(f'inline_options = {inline_options.__class__.__name__}')

return InlineComparator().register(self, inline_options)

3 changes: 1 addition & 2 deletions approvaltests/namer/inline_comparator.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ def get_caller_method(caller_frame) -> Callable:

#return InlineComparator().register(self, inline_options)
def register(self, options: "Options", inline_options: InlineOptions = None):
inline_options = InlineOptions() if inline_options is None else inline_options
inline_options = InlineOptions.show_code() if inline_options is None else inline_options
options2 = options.with_namer(self)
print(f'inline_options = {inline_options.__class__.__name__}')
options2 = inline_options.apply(options2)

return options2
42 changes: 1 addition & 41 deletions tests/test_inline_approvals.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,44 +180,4 @@ def test_bug_blank_lines():
verify(
"\n\ntest bug with blank lines\n\n\n\n",
options=Options().inline()
)





def test_semi_automatic_inline_reporter():
"""
1
2
"""
#verify("1\n2\n5", options=Options().inline(InlineOptions.semi_automatic()))
#verify("1\n2\n5", options=Options().inline(InlineOptions.automatic()))
# verify("1\n2\n5", options=Options().inline(InlineOptions.applesauce())) # when it is false
#verify("1\n2\n5", options=Options().inline(InlineOptions.show_code()))
verify("1\n2\n5", options=Options().inline(InlineOptions.show_code()))

# show_code
# keep show_code becase we only want to change one thing at time

# reports contents only
# report contents without showing code
# compare full source code
# report on
# inline only on test resutls
#report docstring only only report the docstring
# report results only
# report results and docstring
#use diffcompare in traditional way
# use diffcompare in inline way
#only report the results
# report results only
# report results without surrounding code
# report results no surrounding code
# results only
# no surrounding code
# diffcompare in inline way
# ---
# showcode = false
#
)

0 comments on commit 4bd9045

Please sign in to comment.