diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2019-10-14 12:08:22 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2019-10-14 12:08:22 -0400 |
commit | 0688836f584721250609748b03be0de0cea968b9 (patch) | |
tree | 8b8ddb425b3575e7216c68b4cd357b3d0b6cefc2 | |
parent | 314d1f7d33d4bf6f292cf62e6a1e68b713828a29 (diff) | |
download | python-coveragepy-git-0688836f584721250609748b03be0de0cea968b9.tar.gz |
This test accidentally triggered our exclude regex during metacov
-rw-r--r-- | tests/gold/README.rst | 3 | ||||
-rw-r--r-- | tests/gold/html/partial/index.html | 2 | ||||
-rw-r--r-- | tests/gold/html/partial/partial_py.html | 12 | ||||
-rw-r--r-- | tests/test_html.py | 14 |
4 files changed, 16 insertions, 15 deletions
diff --git a/tests/gold/README.rst b/tests/gold/README.rst index 85f6931a..aec00c71 100644 --- a/tests/gold/README.rst +++ b/tests/gold/README.rst @@ -15,7 +15,8 @@ manually inspect the differences. Do this to clean the output directories and run only the failed tests while keeping the output:: - make clean; COVERAGE_KEEP_TMP=1 tox -e py37 -- --lf + rm -rf $TMPDIR/coverage_test + COVERAGE_KEEP_TMP=1 tox -e py37 -- --lf The saved HTML files in the html directories can't be viewed properly without the supporting CSS and Javascript files. But we don't want to save copies of diff --git a/tests/gold/html/partial/index.html b/tests/gold/html/partial/index.html index 3901f941..fa1ec4ad 100644 --- a/tests/gold/html/partial/index.html +++ b/tests/gold/html/partial/index.html @@ -84,7 +84,7 @@ <div class="content"> <p> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>, - created at 2019-10-14 09:27 + created at 2019-10-14 12:01 </p> </div> </div> diff --git a/tests/gold/html/partial/partial_py.html b/tests/gold/html/partial/partial_py.html index 25846ab8..f004808a 100644 --- a/tests/gold/html/partial/partial_py.html +++ b/tests/gold/html/partial/partial_py.html @@ -53,7 +53,7 @@ </div> <div id="source"> <p id="t1" class="pln"><span class="n"><a href="#t1">1</a></span><span class="t"><span class="com"># partial branches and excluded lines</span> </span><span class="r"></span></p> - <p id="t2" class="run"><span class="n"><a href="#t2">2</a></span><span class="t"><span class="nam">a</span> <span class="op">=</span> <span class="num">6</span> </span><span class="r"></span></p> + <p id="t2" class="run"><span class="n"><a href="#t2">2</a></span><span class="t"><span class="nam">a</span> <span class="op">=</span> <span class="num">2</span> </span><span class="r"></span></p> <p id="t3" class="pln"><span class="n"><a href="#t3">3</a></span><span class="t"> </span><span class="r"></span></p> <p id="t4" class="par run show_par"><span class="n"><a href="#t4">4</a></span><span class="t"><span class="key">while</span> <span class="str">"no peephole"</span><span class="op">.</span><span class="nam">upper</span><span class="op">(</span><span class="op">)</span><span class="op">:</span> <span class="com"># t4</span> </span><span class="r"><span class="annotate short">4 ↛ 7</span><span class="annotate long">line 4 didn't jump to line 7, because the condition on line 4 was never false</span></span></p> <p id="t5" class="run"><span class="n"><a href="#t5">5</a></span><span class="t"> <span class="key">break</span> </span><span class="r"></span></p> @@ -64,17 +64,17 @@ <p id="t10" class="pln"><span class="n"><a href="#t10">10</a></span><span class="t"><span class="key">if</span> <span class="num">0</span><span class="op">:</span> </span><span class="r"></span></p> <p id="t11" class="pln"><span class="n"><a href="#t11">11</a></span><span class="t"> <span class="nam">never_happen</span><span class="op">(</span><span class="op">)</span> </span><span class="r"></span></p> <p id="t12" class="pln"><span class="n"><a href="#t12">12</a></span><span class="t"> </span><span class="r"></span></p> - <p id="t13" class="pln"><span class="n"><a href="#t13">13</a></span><span class="t"><span class="key">if</span> <span class="num">1</span><span class="op">:</span> </span><span class="r"></span></p> - <p id="t14" class="run"><span class="n"><a href="#t14">14</a></span><span class="t"> <span class="nam">a</span> <span class="op">=</span> <span class="num">21</span> </span><span class="r"></span></p> + <p id="t13" class="pln"><span class="n"><a href="#t13">13</a></span><span class="t"><span class="key">if</span> <span class="num">13</span><span class="op">:</span> </span><span class="r"></span></p> + <p id="t14" class="run"><span class="n"><a href="#t14">14</a></span><span class="t"> <span class="nam">a</span> <span class="op">=</span> <span class="num">14</span> </span><span class="r"></span></p> <p id="t15" class="pln"><span class="n"><a href="#t15">15</a></span><span class="t"> </span><span class="r"></span></p> - <p id="t16" class="run"><span class="n"><a href="#t16">16</a></span><span class="t"><span class="key">if</span> <span class="nam">a</span> <span class="op">==</span> <span class="num">23</span><span class="op">:</span> </span><span class="r"></span></p> - <p id="t17" class="exc show_exc"><span class="n"><a href="#t17">17</a></span><span class="t"> <span class="key">raise</span> <span class="nam">AssertionError</span><span class="op">(</span><span class="str">"Can't"</span><span class="op">)</span> </span><span class="r"></span></p> + <p id="t16" class="run"><span class="n"><a href="#t16">16</a></span><span class="t"><span class="key">if</span> <span class="nam">a</span> <span class="op">==</span> <span class="num">16</span><span class="op">:</span> </span><span class="r"></span></p> + <p id="t17" class="exc show_exc"><span class="n"><a href="#t17">17</a></span><span class="t"> <span class="key">raise</span> <span class="nam">ZeroDivisionError</span><span class="op">(</span><span class="str">"17"</span><span class="op">)</span> </span><span class="r"></span></p> </div> <div id="footer"> <div class="content"> <p> <a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>, - created at 2019-10-14 09:27 + created at 2019-10-14 12:01 </p> </div> </div> diff --git a/tests/test_html.py b/tests/test_html.py index 1300f22b..77e068d0 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -887,7 +887,7 @@ assert len(math) == 18 def test_partial(self): self.make_file("partial.py", """\ # partial branches and excluded lines - a = 6 + a = 2 while "no peephole".upper(): # t4 break @@ -898,11 +898,11 @@ assert len(math) == 18 if 0: never_happen() - if 1: - a = 21 + if 13: + a = 14 - if a == 23: - raise AssertionError("Can't") + if a == 16: + raise ZeroDivisionError("17") """) self.make_file("partial.ini", """\ [run] @@ -910,7 +910,7 @@ assert len(math) == 18 [report] exclude_lines = - raise AssertionError + raise ZeroDivisionError """) cov = coverage.Coverage(config_file="partial.ini") @@ -924,7 +924,7 @@ assert len(math) == 18 '<p id="t7" class="run">', # The "if 0" and "if 1" statements are optimized away. '<p id="t10" class="pln">', - # The "raise AssertionError" is excluded by regex in the .ini. + # The "raise ZeroDivisionError" is excluded by regex in the .ini. '<p id="t17" class="exc show_exc">', ) contains( |