Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make `python setup.py test -q` quieter?

I've just started a Pyramid project, following the recommendations from the Pyramid docs.

The command for testing looks like this:

../bin/python setup.py test -q

..which gives me this result:

$ ../bin/python setup.py test -q
running test
running egg_info
writing requirements to climas_ng.egg-info/requires.txt
writing climas_ng.egg-info/PKG-INFO
writing top-level names to climas_ng.egg-info/top_level.txt
writing dependency_links to climas_ng.egg-info/dependency_links.txt
writing entry points to climas_ng.egg-info/entry_points.txt
reading manifest file 'climas_ng.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.rst'
warning: no files found matching '*.txt' under directory 'climasng'
warning: no files found matching '*.mak' under directory 'climasng'
warning: no files found matching '*.mako' under directory 'climasng'
warning: no files found matching '*.xml' under directory 'climasng'
writing manifest file 'climas_ng.egg-info/SOURCES.txt'
running build_ext
..........
----------------------------------------------------------------------
Ran 10 tests in 0.629s

OK
$ 

That's very wordy. Is there a way to run my unit tests that doesn't tell me all the reading and writing and (AFAICT) irrelevant warnings?

Ideally I'd like output more like this:

$ ../bin/python setup.py test -q
running test
..........
----------------------------------------------------------------------
Ran 10 tests in 0.629s

OK
$ 

I've looked at setup.py and the test task isn't defined there, I guess it's baked into setuptools.

The -q quiet option I'm already using switches from one-full-line-per-test to one-dot-per-test, which is great, but doesn't quieten the other noise. There's no -Q or -qq for "very quiet".

Am I missing something? Or do I just have to get used to 15 lines of useless info before the good stuff appears.

like image 807
Daniel Baird Avatar asked Jan 09 '14 06:01

Daniel Baird


1 Answers

The position of arguments is important here. Move the -q switch back a bit:

python setup.py -q test

This makes the switch a global one, and suppresses the build output. Any switches for the tests must come after the test command.

like image 175
tuomur Avatar answered Nov 05 '22 20:11

tuomur