Giter Site home page Giter Site logo

Comments (9)

CleanCut avatar CleanCut commented on July 26, 2024

Yes!

If you will tell me where in your process you want to launch them from, I can point you in the right direction. For example, is it from a Makefile? From bash? From another python script? From the test file itself?

from green.

CleanCut avatar CleanCut commented on July 26, 2024

I'm going to go ahead and close this issue, but feel free to reply if you would like help from me. I'll still get notified even though it's closed.

from green.

laike9m avatar laike9m commented on July 26, 2024
tests = unittest.TestLoader().discover(
            os.path.join(setup_dir, 'tests'), pattern='*.py')
unittest.TextTestRunner().run(tests)

How to run this code using green?

from green.

kxepal avatar kxepal commented on July 26, 2024

What's the point of using green in this place? unittest does discovery and testing well.

from green.

laike9m avatar laike9m commented on July 26, 2024

@kxepal Quote from green's readme:

Green grew out of a desire to see pretty colors.

People use green for better discovering or testing? Of course not. If what I need is not prettier output, why do I use green?

from green.

CleanCut avatar CleanCut commented on July 26, 2024

@laike9m I believe something like this should work:

from green.suite import GreenTestSuite
from green.runner import run
from green.config import default_args
# If you want to change options, modify default_args here
# default_args.verbose = 3   # etc.
tests = unittest.TestLoader().discover(
            os.path.join(setup_dir, 'tests'), pattern='*.py')
run(GreenTestSuite(tests), sys.stdout, default_args)

from green.

laike9m avatar laike9m commented on July 26, 2024

Thx CleanCut, I'll try.

from green.

laike9m avatar laike9m commented on July 26, 2024

@CleanCut Works as expected. Thx again! Why don't you put it into documentation?

from green.

CleanCut avatar CleanCut commented on July 26, 2024

Well, if I'm going to officially support it, I'd rather add a new feature so it goes something more like:

from green import runTestSuite
tests = (however you want to manually load tests)
runTestSuite(tests)

from green.

Related Issues (20)

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.