Skip to content

Instantly share code, notes, and snippets.

@frankhillard
Created November 25, 2019 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frankhillard/e37818167c9e33090387bc214ae8be2e to your computer and use it in GitHub Desktop.
Save frankhillard/e37818167c9e33090387bc214ae8be2e to your computer and use it in GitHub Desktop.
example of catching exception with pytzeos
def test_increaseCounterBy_negative_value_should_throw_exception(self):
try:
# Given
    increase_value = -1
# When
    self.contract.increaseCounterBy(increase_value).result(storage=0)
except MichelsonRuntimeError as e:
# Then
    return self.assertTrue("value should be > 0" in str(e))
self.fail("This fail should not happen.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment