Open jayvdb opened 7 years ago
@jayvdb The actual problem is stated at https://github.com/CleanCut/green#external-structure
- The test modules need to start with
test
.
@jayvdb Take a look at https://github.com/pchomik/pytest-spec
It gives equally nice (and colored) output:
$ py.test -vv --spec
...
tests/bears/BearTest.py::BearTest
[PASS] Bad bear
[PASS] Check prerequisites
[PASS] Default aspects
[PASS] Dependencies
[PASS] Detect and fix aspects
[PASS] Get config dir
[PASS] Get non optional settings
[PASS] Inconvertible
[PASS] Message queue
[PASS] New result
[PASS] No detect aspects
[PASS] No fix aspects
[PASS] No queue
[PASS] Print filename LocalBear
[PASS] Print no filename GlobalBear
[PASS] Simple api
...
green is more than an output formatter.
And this bug is about that 3
in that output, and the configuration needed for green
to work correctly by default, or discussing any changes needed.
@jayvdb You can run our tests with green --file-pattern "*Test.py"
Or you create some arbitrarily named config file, let's say .green
(which is the name of the global config file green looks for in $HOME
), containing:
file-pattern = *Test.py
and run green --config .green
Regarding the 3
: I debugged it but I couldn't find any reason for that so far :/
@jayvdb
coala/tests/misc/test_caching_multi_results/test.py
has a print statement at global scope:
a = 3
print(a)
@userzimmermann is correct ... you can either follow the default unittest discovery structure of filenames matching test*py
, or you can specify your own file-matching pattern with command-line options or config files.
Either way, Green expects tests to be methods of a unittest.TestCase
subclass and methods that match a specific naming pattern (test*
by default, also overridable).
@CleanCut And I am debugging my time away instead of just grep'ing for the most obvious :D
That just means you are a much harder worker than I am... ;-)
Note that test discovery without patterns is https://github.com/CleanCut/green/issues/87
And per project configuration is https://github.com/CleanCut/green/issues/116
[edit] or re-use setup.py test information : https://github.com/CleanCut/green/issues/158
We need either of those to work before we can support green.
Ah, well per-project configuration has been at the top of the list for me, so...it's at the top of the list. :-/ Gotta make time.
@jayvdb Wife and son sick with the flu today. In between taking care of them I implemented per-project configuration support for green. Included in Green 2.8.0 (just released).
Very likely due to https://github.com/coala/coala/issues/3808 and other issues, on c929a8b45, this is the output of https://github.com/CleanCut/green