Giter VIP home page Giter VIP logo

Comments (2)

mdwhatcott avatar mdwhatcott commented on May 30, 2024

My original plan was to integrate with unittest, or maybe as a nose plugin. I did some investigation into unittest and nose and just didn't have the patience to come to a thorough understanding of how to hook into either of them effectively. It's probably a lot easier than it seemed to me at the time but I was anxious to get something working so I went ahead with a standalone project.

Basically, we need to be able to run several setup methods (given, when, collect) followed by one or more assertion methods (then), and ending with a single cleanup method (after). One aspect of unittest that seemed like trouble was its philosophy of running the setup code for every test method in a class, which is just extra work.

Are you already an expert (or would you like to become an expert) with the innards of unittest or nose? I'd welcome your input/contributions in this direction. Thanks for reaching out!

from pyspecs.

mdwhatcott avatar mdwhatcott commented on May 30, 2024

BTW, I should mention that when I was first experimenting with the idea for this project I did have a TestCase-based solution:

https://github.com/mdwhatcott/pyspecs-depracated/tree/experimental

The 'experimental' branch implemented a class (UnitSpec) that inherits from TestCase and is picked up the the unittest runner. The only problem with it is that the setup methods (@given, @when) are run for each assertion method (@then) which I couldn't live with in the long-term. The classmethod-based setup and teardown functions seemed cumbersome to hook into. Any ideas?

from pyspecs.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.