From 9170df448475b4486a946263650a4a870870657a Mon Sep 17 00:00:00 2001 From: zooko <> Date: Wed, 6 Aug 2014 22:12:32 +0000 Subject: [PATCH] --rterrors for trial [Imported from Trac: page HowToWriteTests, version 7] --- HowToWriteTests.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/HowToWriteTests.md b/HowToWriteTests.md index 63363d2..c695e26 100644 --- a/HowToWriteTests.md +++ b/HowToWriteTests.md @@ -7,7 +7,7 @@ touch src/allmydata/test/test_fname.py ``` ``` -./bin/tahoe debug trial allmydata.test.test_fname +./bin/tahoe debug trial --rterrors allmydata.test.test_fname ``` Okay, so it didn't work, because there is no file by that name. Create such a file, with these contents: @@ -27,13 +27,13 @@ Now run it! Now install Ned Batchelder's "[coverage"](http://nedbatchelder.com/code/coverage/) tool and run your with code coverage, like this: ``` -./bin/tahoe @coverage run --branch --include='src/allmydata/*' @tahoe debug trial allmydata.test.test_fname +./bin/tahoe @coverage run --branch --include='src/allmydata/*' @tahoe debug trial --rterrors allmydata.test.test_fname ``` If you installed coverage from Debian or Ubuntu then you have to name it `python-coverage`, like this: ``` -./bin/tahoe @python-coverage run --branch --include='src/allmydata/*' @tahoe debug trial allmydata.test.test_fname +./bin/tahoe @python-coverage run --branch --include='src/allmydata/*' @tahoe debug trial --rterrors allmydata.test.test_fname ``` This does the same as running the tests without coverage -- print a list of what happened when each test was run. It also writes out a file named `.coverage` into the current directory. Run the following command to read that file and produce nice HTML pages: