Skip to content

Commit

Permalink
*** Ready to implement allow multiple verify calls for this method
Browse files Browse the repository at this point in the history
Co-Authored-By: 4dsherwood <4dsherwood@users.noreply.github.com>
Co-Authored-By: blade290 <43077216+blade290@users.noreply.github.com>
Co-Authored-By: Nitsan Avni <nitsanav@gmail.com>
Co-Authored-By: jmasonlee <262853+jmasonlee@users.noreply.github.com>
Co-Authored-By: Nazee Hajebi <2491283+NazeeHajebi@users.noreply.github.com>
Co-Authored-By: Samuel Taggart <Samuel.Taggart@gmail.com>
  • Loading branch information
7 people committed Oct 8, 2023
1 parent ddb49a5 commit 818b76c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
3 changes: 2 additions & 1 deletion approvaltests/approvals.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
__unittest = True
__tracebackhide__ = True


def settings() -> Settings:
return Setting()
def set_default_reporter(reporter: Reporter) -> None:
return approvaltests.reporters.default_reporter_factory.set_default_reporter(
reporter
Expand Down
2 changes: 1 addition & 1 deletion mob-sessions-retros/2023-10-01 Session Notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The feature we are working (which is: raising an error if a user puts multiple v
## Decisions with Llewellyn

- Remove the Feature Toggle
- the tests can pass by Expecting an exception
- ~~the tests can pass by Expecting an exception~~
- draw inspiration from Java Approval Tests
- take the text from Java Approval Tests for consistency
- keep WIP at one; iow don't work on more than one thing at once
Expand Down
9 changes: 9 additions & 0 deletions mob-sessions-retros/2023-10-08 Session Notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
10/8

1. ~~Decorator for method + decorator for class~~
2. setting for globalstate: allowMultipleVerifyCallsForThisFile()
3. ~~try block with~~
4. add options every + give suggestions on how to do this easier
5. currying
6. method over
7. default options.
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import pytest

from approvaltests import verify, ApprovalException
from approvaltests import verify, ApprovalException, settings
from approvaltests.file_approver import error_on_multiple_verify_calls


#


def test_multiple_calls_to_verify():
error_on_multiple_verify_calls(True)
verify("call to verify")
Expand All @@ -16,7 +13,9 @@ def test_multiple_calls_to_verify():


def test_old_way():
error_on_multiple_verify_calls(False)
error_on_multiple_verify_calls(True)
settings().allow_multiple_verify_calls_for_this_method()
# TODO: start here
verify("call to verify")
verify("call to verify")
error_on_multiple_verify_calls(False)
Expand Down

0 comments on commit 818b76c

Please sign in to comment.