← Back to team overview

testtools-dev team mailing list archive

[RFC] assert_that function

 

Hello all,

I've just opened https://github.com/testing-cabal/testtools/pull/70
which introduces an assert_that function.

This will allow matchers to be used outside of the TestCase context.
This is useful for people who can't buy in to testtools.TestCase fully
(for whatever reason), or who like using function/generator tests (as
supported by nose).

This isn't a full patch (and so shouldn't be merged as-is), but I wanted
to get feedback on whether this approach would be acceptable before
doing anything else.

Assuming it is acceptable, thoughts on how best to test it would be
appreciated. My initial instinct was to modify all of the tests
exercising the core behaviour I've extracted to point at assert_that and
write some new tests to ensure that assertThat consumes the assert_that
API correctly.

However, as we will be exposing essentially the same API in two places
(assert_that and self.assertThat), I wonder if we should run the
core-behaviour tests against both places by parameterising them somehow,
so we're fully testing our public API. Thoughts appreciated.


Please do let me know what you think!


Thanks,

Dan


Follow ups