aboutsummaryrefslogtreecommitdiffstats
path: root/testing/py3-cairosvg/fix-flaky-tests.patch
diff options
context:
space:
mode:
Diffstat (limited to 'testing/py3-cairosvg/fix-flaky-tests.patch')
-rw-r--r--testing/py3-cairosvg/fix-flaky-tests.patch71
1 files changed, 0 insertions, 71 deletions
diff --git a/testing/py3-cairosvg/fix-flaky-tests.patch b/testing/py3-cairosvg/fix-flaky-tests.patch
deleted file mode 100644
index 3a974d7ca6..0000000000
--- a/testing/py3-cairosvg/fix-flaky-tests.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From 1b9542f941dad041a16e49b732d8f2ba9fe28e7d Mon Sep 17 00:00:00 2001
-From: Guillaume Ayoub <guillaume.ayoub@kozea.fr>
-Date: Thu, 22 Aug 2019 12:11:21 +0200
-Subject: [PATCH] Only use 100 bytes of generated documents for API testing
-
-As we mainly test the format here (and not the content), using the whole file
-is useless. It also allows small differences between reference and tested
-documents, like the generation date for PDF files.
-
-Fix #247.
----
- cairosvg/test_api.py | 16 ++++++++--------
- 1 file changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/cairosvg/test_api.py b/cairosvg/test_api.py
-index f29db80..7d8835f 100644
---- a/cairosvg/test_api.py
-+++ b/cairosvg/test_api.py
-@@ -144,10 +144,10 @@ def test_low_level_api():
-
- def test_script():
- """Test the ``cairosvg`` script and the ``main`` function."""
-- expected_png = svg2png(SVG_SAMPLE)
-- expected_pdf = svg2pdf(SVG_SAMPLE)
-+ expected_png = svg2png(SVG_SAMPLE)[:100]
-+ expected_pdf = svg2pdf(SVG_SAMPLE)[:100]
-
-- def test_main(args, exit_=False, input_=None):
-+ def test_main(args, exit_=False, input_=None, full=False):
- """Test main called with given ``args``.
-
- If ``exit_`` is ``True``, check that ``SystemExit`` is raised. We then
-@@ -179,7 +179,7 @@ def test_main(args, exit_=False, input_=None):
- sys.stdout.flush()
- output = output_buffer.getvalue()
- sys.stdin, sys.stdout = old_stdin, old_stdout
-- return output
-+ return output if full else output[:100]
-
- with tempfile.NamedTemporaryFile(delete=False) as file_object:
- file_object.write(SVG_SAMPLE)
-@@ -198,7 +198,7 @@ def test_main(args, exit_=False, input_=None):
- assert test_main(['-'], input_=svg_filename) == expected_pdf
-
- # Test DPI
-- output = test_main([svg_filename, '-d', '10', '-f', 'png'])
-+ output = test_main([svg_filename, '-d', '10', '-f', 'png'], full=True)
- image = cairo.ImageSurface.create_from_png(io.BytesIO(output))
- assert image.get_width() == 40
- assert image.get_height() == 50
-@@ -208,17 +208,17 @@ def test_main(args, exit_=False, input_=None):
- temp_1 = os.path.join(temp, 'result_1')
- # Default to PDF
- assert not test_main([svg_filename, '-o', temp_1])
-- assert read_file(temp_1) == expected_pdf
-+ assert read_file(temp_1)[:100] == expected_pdf
-
- temp_2 = os.path.join(temp, 'result_2.png')
- # Guess from the file extension
- assert not test_main([svg_filename, '-o', temp_2])
-- assert read_file(temp_2) == expected_png
-+ assert read_file(temp_2)[:100] == expected_png
-
- temp_3 = os.path.join(temp, 'result_3.png')
- # Explicit -f wins
- assert not test_main([svg_filename, '-o', temp_3, '-f', 'pdf'])
-- assert read_file(temp_3) == expected_pdf
-+ assert read_file(temp_3)[:100] == expected_pdf
- finally:
- shutil.rmtree(temp)
-