You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To achieve a sintax similar to ruby's RSpec, it seems to me that the use of Context Managers could be an option:
withdescribe('a thing'):
@pytest.fixturedeffoo():
return'foo'withit('does a thing', foo):
assertfoo=='foo'
A potential issue is the 'assert' statements being evaluated before collection. We could prevent that by wrapping it inside a function that saves it for later evaluation:
withdescribe('a thing'):
@pytest.fixturedeffoo():
return'foo'withit('does a thing', foo):
the_foo='foos'_assert(foo==the_foo, f'the_foo should be foo, instead got {the_foo}')
withit('does another thing', foo):
_assert(foo=='foo')
What would be the restrictions to implement such notation?
The text was updated successfully, but these errors were encountered:
To achieve a sintax similar to ruby's RSpec, it seems to me that the use of Context Managers could be an option:
A potential issue is the 'assert' statements being evaluated before collection. We could prevent that by wrapping it inside a function that saves it for later evaluation:
What would be the restrictions to implement such notation?
The text was updated successfully, but these errors were encountered: