summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bench/bench.py17
-rw-r--r--tox.ini2
2 files changed, 10 insertions, 9 deletions
diff --git a/bench/bench.py b/bench/bench.py
index 2baa92440..0a356a990 100644
--- 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)
diff --git a/tox.ini b/tox.ini
index 264233beb..b0e4a0383 100644
--- 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