Open ssfrr opened 10 years ago
I should also note that it feels a little sketchy for the @setup
and @teardown
blocks to just get pasted into the fact body. One option would be to have the testing do
block take an argument that has any testing environment created by @setup
I'm going to tag this one as "up for grabs" because I feel a lot of macro magics are required to make this work well, and a similar effect can be achieved with just good old-fashioned functions.
A question: have you considered doing the setup/teardown in pytest fixtures style.? I am using pytest a lot now, and after a moment of getting used to I grew very fond of this approach.
BTW, do you have any knowledge of any testing framework for Julia that would try to mimic pytest's idea?
Often a set of tests has some common setup and teardown code you want to run for each test. It would be great to be able to do something like:
I think that it would make sense that
@setup
block defined at the module scope would be run for eachfacts
block, and@setup
defined inside afacts
block would apply to eachcontext