CleanCut / green

Green is a clean, colorful, fast python test runner.
MIT License
785 stars 75 forks source link

green might hang on async tests #263

Closed WolfgangFahl closed 1 year ago

WolfgangFahl commented 1 year ago

https://github.com/justpy-org/justpy tries using green for tests in the scripts directory i tried using green

i had to uncomment it and replace with python -m unittest

modulewise_test() {
  for testmodule in tests/test*.py
  do
    echo "testing $testmodule ..."
    #green $testmodule
    python -m unittest $testmodule
  done
}

since

 green tests/test_demostarter.py 

simply hangs while

python -m unittest tests/test_demostarter.py 
Starting test testDemoStarter, debug=False ...
found 38 justpy demo python modules
starting   1:examples.tutorial.page_events.loading_page_no_stagger:loading_page_no_stagger:loading_page_no_stagger  ...

works just fine ...

CleanCut commented 1 year ago

green's use of subprocesses is unlikely to play well with async. You can restrict green to a single subprocess with -s 1 or --processes 1 and it might work.

WolfgangFahl commented 1 year ago

@CleanCut Thx - actually works better and very helpful to know

CleanCut commented 1 year ago

Great! Glad to hear it. 😄