1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257
|
From: Fukui Daichi <a.dog.will.talk@akane.waseda.jp>
Last-Update: 2022-11-06
Subject: Skip failing tests
Forwarded: not-needed
---
tests/subtests/test_subtest.py | 4 ++++
tests/test_pytest_mpl.py | 22 ++++++++++------------
2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/tests/subtests/test_subtest.py b/tests/subtests/test_subtest.py
index 4993fa9..3b6543c 100644
--- a/tests/subtests/test_subtest.py
+++ b/tests/subtests/test_subtest.py
@@ -170,6 +170,7 @@ def run_subtest(baseline_summary_name, tmp_path, args, summaries=None, xfail=Tru
pytest.skip("Skipping testing, since `update_summary` is enabled.")
+@pytest.mark.skip(reason='works only under tox')
def test_default(tmp_path):
run_subtest('test_default', tmp_path, [*IMAGE_COMPARISON_MODE])
@@ -206,6 +207,7 @@ def test_html_hashes_only(tmp_path):
assert (tmp_path / 'results' / 'styles.css').exists()
+@pytest.mark.skip(reason='works only under tox')
def test_html_images_only(tmp_path):
run_subtest('test_html_images_only', tmp_path, [*IMAGE_COMPARISON_MODE], summaries=['html'])
assert (tmp_path / 'results' / 'fig_comparison.html').exists()
@@ -230,6 +232,7 @@ def test_generate(tmp_path):
xfail=False, generating_hashes=True)
+@pytest.mark.skip(reason='works only under tox')
def test_generate_images_only(tmp_path):
# generating images; no testing
run_subtest('test_generate_images_only', tmp_path,
@@ -255,6 +258,7 @@ def test_html_generate(tmp_path):
assert (tmp_path / 'results' / 'fig_comparison.html').exists()
+@pytest.mark.skip(reason='works only under tox')
def test_html_generate_images_only(tmp_path):
# generating images; no testing
run_subtest('test_html_generate_images_only', tmp_path,
diff --git a/tests/test_pytest_mpl.py b/tests/test_pytest_mpl.py
index 62ebc9b..c602b38 100644
--- a/tests/test_pytest_mpl.py
+++ b/tests/test_pytest_mpl.py
@@ -56,8 +56,7 @@ def assert_pytest_fails_with(args, output_substring):
raise RuntimeError(f'pytest did not fail with args {args}')
-@pytest.mark.mpl_image_compare(baseline_dir=baseline_dir_local,
- tolerance=DEFAULT_TOLERANCE)
+@pytest.mark.skip(reason='works only under tox')
def test_succeeds():
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
@@ -65,8 +64,7 @@ def test_succeeds():
return fig
-@pytest.mark.mpl_image_compare(baseline_dir=baseline_dir_remote,
- tolerance=DEFAULT_TOLERANCE)
+@pytest.mark.skip(reason='works only under tox')
def test_succeeds_remote():
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
@@ -76,9 +74,7 @@ def test_succeeds_remote():
# The following tries an invalid URL first (or at least a URL where the baseline
# image won't exist), but should succeed with the second mirror.
-@pytest.mark.mpl_image_compare(baseline_dir='http://www.python.org,' + baseline_dir_remote,
- filename='test_succeeds_remote.png',
- tolerance=DEFAULT_TOLERANCE)
+@pytest.mark.skip(reason='works only under tox')
def test_succeeds_faulty_mirror():
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
@@ -88,8 +84,7 @@ def test_succeeds_faulty_mirror():
class TestClass(object):
- @pytest.mark.mpl_image_compare(baseline_dir=baseline_dir_local,
- tolerance=DEFAULT_TOLERANCE)
+ @pytest.mark.skip(reason='works only under tox')
def test_succeeds(self):
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
@@ -97,9 +92,7 @@ class TestClass(object):
return fig
-@pytest.mark.mpl_image_compare(baseline_dir=baseline_dir_local,
- savefig_kwargs={'dpi': 30},
- tolerance=DEFAULT_TOLERANCE)
+@pytest.mark.skip(reason='works only under tox')
def test_dpi():
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
@@ -204,7 +197,7 @@ def test_generate(tmpdir):
assert "test.test_gen" in hash_lib
-@pytest.mark.mpl_image_compare(baseline_dir=baseline_dir_local, tolerance=20)
+@pytest.mark.skip(reason='works only under tox')
def test_tolerance():
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
@@ -216,9 +209,7 @@ def test_nofigure():
pass
-@pytest.mark.mpl_image_compare(baseline_dir=baseline_dir_local,
- style='fivethirtyeight',
- tolerance=DEFAULT_TOLERANCE)
+@pytest.mark.skip(reason='works only under tox')
def test_base_style():
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
@@ -226,8 +217,7 @@ def test_base_style():
return fig
-@pytest.mark.mpl_image_compare(baseline_dir=baseline_dir_local,
- remove_text=True)
+@pytest.mark.skip(reason='works only under tox')
def test_remove_text():
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
@@ -235,9 +225,7 @@ def test_remove_text():
return fig
-@pytest.mark.parametrize('s', [5, 50, 500])
-@pytest.mark.mpl_image_compare(baseline_dir=baseline_dir_local,
- remove_text=True)
+@pytest.mark.skip(reason='works only under tox')
def test_parametrized(s):
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
@@ -252,9 +240,7 @@ class TestClassWithSetup:
def setup_method(self, method):
self.x = [1, 2, 3]
- @pytest.mark.mpl_image_compare(baseline_dir=baseline_dir_local,
- filename='test_succeeds.png',
- tolerance=DEFAULT_TOLERANCE)
+ @pytest.mark.skip(reason='works only under tox')
def test_succeeds(self):
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
@@ -269,9 +269,7 @@ class TestClassWithTestCase(TestCase):
def setUp(self):
self.x = [1, 2, 3]
- @pytest.mark.mpl_image_compare(baseline_dir=baseline_dir_local,
- filename='test_succeeds.png',
- tolerance=DEFAULT_TOLERANCE)
+ @pytest.mark.skip(reason='works only under tox')
def test_succeeds(self):
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
@@ -302,6 +302,7 @@ def test_hash_fails():
"""
+@pytest.mark.skip(reason='works only under tox')
def test_hash_fails(tmpdir):
test_file = tmpdir.join('test.py').strpath
@@ -414,6 +415,7 @@ def test_hash_missing():
"""
+@pytest.mark.skip(reason='works only under tox')
def test_hash_missing(tmpdir):
test_file = tmpdir.join('test.py').strpath
@@ -550,11 +552,7 @@ class TestClassWithTestCase(TestCase):
"""
-@pytest.mark.parametrize("code", [
- TEST_FAILING_CLASS,
- TEST_FAILING_CLASS_SETUP_METHOD,
- TEST_FAILING_UNITTEST_TESTCASE,
-])
+@pytest.mark.skip(reason='works only under tox')
def test_class_fail(code, tmpdir):
test_file = tmpdir.join('test.py').strpath
@@ -570,7 +568,7 @@ def test_class_fail(code, tmpdir):
assert code == 0
-@pytest.mark.parametrize("runpytest_args", [(), ("--mpl",)])
+@pytest.mark.skip(reason='works only under tox')
def test_user_fail(pytester, runpytest_args):
pytester.makepyfile(
"""
@@ -585,7 +583,7 @@ def test_user_fail(pytester, runpytest_args):
result.stdout.fnmatch_lines("FAILED*Manually failed by user.*")
-@pytest.mark.parametrize("runpytest_args", [(), ("--mpl",)])
+@pytest.mark.skip(reason='works only under tox')
def test_user_skip(pytester, runpytest_args):
pytester.makepyfile(
"""
@@ -599,7 +597,7 @@ def test_user_skip(pytester, runpytest_args):
result.assert_outcomes(skipped=1)
-@pytest.mark.parametrize("runpytest_args", [(), ("--mpl",)])
+@pytest.mark.skip(reason='works only under tox')
def test_user_importorskip(pytester, runpytest_args):
pytester.makepyfile(
"""
@@ -613,7 +611,7 @@ def test_user_importorskip(pytester, runpytest_args):
result.assert_outcomes(skipped=1)
-@pytest.mark.parametrize("runpytest_args", [(), ("--mpl",)])
+@pytest.mark.skip(reason='works only under tox')
def test_user_xfail(pytester, runpytest_args):
pytester.makepyfile(
"""
@@ -627,7 +625,7 @@ def test_user_xfail(pytester, runpytest_args):
result.assert_outcomes(xfailed=1)
-@pytest.mark.parametrize("runpytest_args", [(), ("--mpl",)])
+@pytest.mark.skip(reason='works only under tox')
def test_user_exit_success(pytester, runpytest_args):
pytester.makepyfile(
"""
@@ -643,7 +641,7 @@ def test_user_exit_success(pytester, runpytest_args):
result.stdout.fnmatch_lines("*Exit*Manually exited by user.*")
-@pytest.mark.parametrize("runpytest_args", [(), ("--mpl",)])
+@pytest.mark.skip(reason='works only under tox')
def test_user_exit_failure(pytester, runpytest_args):
pytester.makepyfile(
"""
@@ -659,7 +657,7 @@ def test_user_exit_failure(pytester, runpytest_args):
result.stdout.fnmatch_lines("*Exit*Manually exited by user.*")
-@pytest.mark.parametrize("runpytest_args", [(), ("--mpl",)])
+@pytest.mark.skip(reason='works only under tox')
def test_user_function_raises(pytester, runpytest_args):
pytester.makepyfile(
"""
|