Skip to content

Instantly share code, notes, and snippets.

@ppmx
Last active February 17, 2020 14:25
Show Gist options
  • Select an option

  • Save ppmx/9eb46e23f5e1e91a245c0a7da2907bc2 to your computer and use it in GitHub Desktop.

Select an option

Save ppmx/9eb46e23f5e1e91a245c0a7da2907bc2 to your computer and use it in GitHub Desktop.
Example for a Test Adapter
class MathClass:
def sqrt(self, x):
import math
return math.sqrt(x)
class TestAdapterMathClass(MathClass):
def sqrt(self, x):
self.assert (x >= 0)
ret = super().sqrt(x)
self.assert (ret * ret == x)
return ret
def assert(self, cond):
# using python's assert() is just an example.
# maybe: if not cond: write_something_to_log()
assert(cond)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment