# HG changeset patch -- Bitbucket.org # Project pytest # URL http://bitbucket.org/hpk42/pytest/overview # User holger krekel <hol...@merlinux.eu> # Date 1290089960 -3600 # Node ID 1e1073e89e9fdaf7e317f887528d075401ad5f87 # Parent 2bd8b95e0ccbc09e3857970821ab219a2401ca56 fix bare "py.test" runs without a directory by not defaulting to --doctest-modules which will virtually import everything
--- a/tox.ini +++ b/tox.ini @@ -63,6 +63,6 @@ commands= [pytest] minversion=2.0 plugins=pytester -addopts= -rxf --pyargs --doctest-modules +addopts= -rxf --pyargs rsyncdirs=tox.ini pytest.py _pytest testing --- a/bench/bench.py +++ b/bench/bench.py @@ -1,9 +1,10 @@ -import cProfile -import py -import pstats -stats = cProfile.run('py.test.cmdline.main(["empty.py", ])', 'prof') -p = pstats.Stats("prof") -p.strip_dirs() -p.sort_stats('cumulative') -print p.print_stats(30) +if __name__ == '__main__': + import cProfile + import py + import pstats + stats = cProfile.run('py.test.cmdline.main(["empty.py", ])', 'prof') + p = pstats.Stats("prof") + p.strip_dirs() + p.sort_stats('cumulative') + print p.print_stats(30) _______________________________________________ py-svn mailing list py-svn@codespeak.net http://codespeak.net/mailman/listinfo/py-svn