Closed shvasude closed 4 years ago
this should work
test_str = "My Example String"
test_str | should.have_substring("Example")
Thanks for this. Curious to know the implementation of have_substring
, i don't see in matchers.py that i usually see for other matchers
Actually most matchers are just defined as aliases to the underlying Hamcrest implementation if no customization is required
https://github.com/drslump/pyshould/blob/master/pyshould/matchers.py#L206-L208
For a quick look at all the registered matchers you can run on a terminal python -m pyshould
to dump their help.
Thanks. Helps
I have a string and i have to assert String which is in string of the variable str
like in python, do we have an example for "in" operator in pyshould: str="Example String" if "Example" in str: return True else: return False