computationalmodelling / nbval

A py.test plugin to validate Jupyter notebooks
Other
442 stars 51 forks source link

No TDD possible with nbval #14

Closed michaelaye closed 7 years ago

michaelaye commented 7 years ago

So, I really like the simplicity of nbval, but was wondering: Sometimes it's really nice to clear you mind about what you actually want from a new module by doing TDD, meaning writing a few tests for the non-existing API or module and then develop it, reducing the failing tests one by one. Do you envision something like that to be possible with nbval?

takluyver commented 7 years ago

My view is that nbval is more a way to check that examples are not broken, rather than a replacement for traditional unit tests.

You could, of course, write a notebook using the public API of a module that doesn't exist yet, ignoring any output, and write the module, using nbval to see when the notebook runs without errors. But that approach doesn't seem terribly practical.

michaelaye commented 7 years ago

ok, thanks!

fangohr commented 7 years ago

Hi @michaelaye, thanks for the comments and input.

I am also interested in realising TDD with Jupyter. I started to put an example together at https://github.com/fangohr/tdd-with-jupyter ; maybe that is of interest.

Any comments and new ideas welcome :)

Best wishes,

Hans

michaelaye commented 7 years ago

Sorry, off-topic but: Hallo Hans und MoinMoin! Hamburger Jung, wa? ;) Ich komm aus Heide/Holstein, war immer gerne in Hamburg. Jetzt in Colorado. Hoffe es regnet nicht noch mehr in Southhampton als in Hamburg! ;)

fangohr commented 7 years ago

Hi Michael and moinmoin, too :) Yes, weather in Southampton is significantly warmer, and also less rainy. Or at least no prolonged periods of rain; compared to Hamburg.