diff options
Diffstat (limited to 'dev-python/pycotap')
-rw-r--r-- | dev-python/pycotap/Manifest | 4 | ||||
-rw-r--r-- | dev-python/pycotap/files/pycotap-1.3.1-fix-python3.13-tests.patch | 213 | ||||
-rw-r--r-- | dev-python/pycotap/metadata.xml | 20 | ||||
-rw-r--r-- | dev-python/pycotap/pycotap-1.3.1.ebuild | 38 |
4 files changed, 275 insertions, 0 deletions
diff --git a/dev-python/pycotap/Manifest b/dev-python/pycotap/Manifest new file mode 100644 index 000000000000..777fa4ba4e04 --- /dev/null +++ b/dev-python/pycotap/Manifest @@ -0,0 +1,4 @@ +AUX pycotap-1.3.1-fix-python3.13-tests.patch 7800 BLAKE2B 5430614b0101fde3d164d213f87ccde702870eaacb0223f88e2cdc5bc8e119319c8bdaa6abaa0b2d9393d303a1884acf138d7167c49870f140f8597a43f32dcf SHA512 525a953c78e478231da5ff7e57dc85cba93b8d224d91a713d02795955177738b162dbdcf35776b95011807d081e9d2b91053f13119aef07e1019a4d2761c4abf +DIST pycotap-1.3.1.tar.gz 7534 BLAKE2B 1566179908dc6fb318632a3e76193b86ec08a560040e1f241195796d0ec3c63a84330be90c05deaff001cb64bc4b5c82e0f1124db442fb0f1982323d21d183f0 SHA512 e7d50340fb4e3f55037a96aaaba419e6753d4499564339b6562317455ed223c3fd93bf41d0bd9654c03a4bea09377daa192ca985bafc96983e4a2261dde348b8 +EBUILD pycotap-1.3.1.ebuild 800 BLAKE2B ee1fd19944ca34e0b12ac4ac95a60007d76a4fc1cac033a4eef8237c0b7b9c4c2e7381b40156bb2d698e10a06d0934055871ad8b7ef3cf900a42a8c6686aecfe SHA512 bff25e0bcd88244cf0a5680d53d66159c43c85cb3d2bbe3882f0ece861186a5cda3dbcf41e777d6edf9f92ff1b66d21ed1deabccd4cf9965d6c5a64024fd76d5 +MISC metadata.xml 625 BLAKE2B 0e21ca6d688ccdc26ace7b15f2334a611e23421669271e93a2a9718ca32193e186c6632c259791889229308e30b529dc478004da475067a6fb22548c5b28cd06 SHA512 bd948585baa4599faadfebdf1c769b4712ab3ea693d7bd0d3f3340b0e51e0af0d69bec1499405c4db07dd0f133df46d5bdf5d3c1729fe61daad9b3506a8bd55e diff --git a/dev-python/pycotap/files/pycotap-1.3.1-fix-python3.13-tests.patch b/dev-python/pycotap/files/pycotap-1.3.1-fix-python3.13-tests.patch new file mode 100644 index 000000000000..7d2943c84751 --- /dev/null +++ b/dev-python/pycotap/files/pycotap-1.3.1-fix-python3.13-tests.patch @@ -0,0 +1,213 @@ +https://github.com/remko/pycotap/pull/14 + +From 514a991fb622c2db2ffcede93d99776cc322c019 Mon Sep 17 00:00:00 2001 +From: Alfred Wingate <parona@protonmail.com> +Date: Tue, 18 Feb 2025 03:02:23 +0200 +Subject: [PATCH] Adjust tests for python3.13 error message changes + +Signed-off-by: Alfred Wingate <parona@protonmail.com> +--- a/test/test.py ++++ b/test/test.py +@@ -73,14 +73,17 @@ class TAPTestRunnerTest(unittest.TestCase): + ) + self.assertEqual( + self.process_output(self.output_stream.getvalue()), ( +- "TAP version 13\n" +- "not ok 1 __main__.TAPTestRunnerTest.test_all_test_outcomes.<locals>.Test.test_failing\n" +- "# Traceback (most recent call last):\n" +- "# File \"test.py\", line X, in test_failing\n" +- "# self.assertEqual(1, 2)\n" +- "# AssertionError: 1 != 2\n" +- "ok 2 __main__.TAPTestRunnerTest.test_all_test_outcomes.<locals>.Test.test_passing\n" +- "ok 3 __main__.TAPTestRunnerTest.test_all_test_outcomes.<locals>.Test.test_skipped # SKIP Not finished yet\n" ++ "TAP version 13\n" + ++ "not ok 1 __main__.TAPTestRunnerTest.test_all_test_outcomes.<locals>.Test.test_failing\n" + ++ "# Traceback (most recent call last):\n" + ++ "# File \"test.py\", line X, in test_failing\n" + ++ "# self.assertEqual(1, 2)\n" + ++ ( ++ "# ~~~~~~~~~~~~~~~~^^^^^^\n" if sys.version_info >= (3,13,) else "" ++ ) + ++ "# AssertionError: 1 != 2\n" + ++ "ok 2 __main__.TAPTestRunnerTest.test_all_test_outcomes.<locals>.Test.test_passing\n" + ++ "ok 3 __main__.TAPTestRunnerTest.test_all_test_outcomes.<locals>.Test.test_skipped # SKIP Not finished yet\n" + + "1..3\n" + ) + ) +@@ -152,17 +155,20 @@ class TAPTestRunnerTest(unittest.TestCase): + ) + self.assertEqual( + self.process_output(self.output_stream.getvalue()), ( +- "TAP version 13\n" +- "not ok 1 __main__.TAPTestRunnerTest.OutputTest.test_failing\n" +- "# Foo\n" +- "# Traceback (most recent call last):\n" +- "# File \"test.py\", line X, in test_failing\n" +- "# self.assertEqual(1, 2)\n" +- "# AssertionError: 1 != 2\n" +- "ok 2 __main__.TAPTestRunnerTest.OutputTest.test_passing\n" +- "# Foo\n" +- "# Baz\n" +- "# Bar\n" ++ "TAP version 13\n" + ++ "not ok 1 __main__.TAPTestRunnerTest.OutputTest.test_failing\n" + ++ "# Foo\n" + ++ "# Traceback (most recent call last):\n" + ++ "# File \"test.py\", line X, in test_failing\n" + ++ "# self.assertEqual(1, 2)\n" + ++ ( ++ "# ~~~~~~~~~~~~~~~~^^^^^^\n" if sys.version_info >= (3,13,) else "" ++ ) + ++ "# AssertionError: 1 != 2\n" + ++ "ok 2 __main__.TAPTestRunnerTest.OutputTest.test_passing\n" + ++ "# Foo\n" + ++ "# Baz\n" + ++ "# Bar\n" + + "1..2\n" + ) + ) +@@ -176,23 +182,26 @@ class TAPTestRunnerTest(unittest.TestCase): + ) + self.assertEqual( + self.process_output(self.output_stream.getvalue()), ( +- "TAP version 13\n" +- "not ok 1 __main__.TAPTestRunnerTest.OutputTest.test_failing\n" +- " ---\n" +- " output: |\n" +- " Foo\n" +- " Traceback (most recent call last):\n" +- " File \"test.py\", line X, in test_failing\n" +- " self.assertEqual(1, 2)\n" +- " AssertionError: 1 != 2\n" +- " ...\n" +- "ok 2 __main__.TAPTestRunnerTest.OutputTest.test_passing\n" +- " ---\n" +- " output: |\n" +- " Foo\n" +- " Baz\n" +- " Bar\n" +- " ...\n" ++ "TAP version 13\n" + ++ "not ok 1 __main__.TAPTestRunnerTest.OutputTest.test_failing\n" + ++ " ---\n" + ++ " output: |\n" + ++ " Foo\n" + ++ " Traceback (most recent call last):\n" + ++ " File \"test.py\", line X, in test_failing\n" + ++ " self.assertEqual(1, 2)\n" + ++ ( ++ " ~~~~~~~~~~~~~~~~^^^^^^\n" if sys.version_info >= (3,13,) else "" ++ ) + ++ " AssertionError: 1 != 2\n" + ++ " ...\n" + ++ "ok 2 __main__.TAPTestRunnerTest.OutputTest.test_passing\n" + ++ " ---\n" + ++ " output: |\n" + ++ " Foo\n" + ++ " Baz\n" + ++ " Bar\n" + ++ " ...\n" + + "1..2\n" + ) + ) +@@ -243,14 +252,17 @@ class TAPTestRunnerTest(unittest.TestCase): + ) + self.assertEqual( + self.process_output(self.error_stream.getvalue()), ( +- "Foo\n" +- "Traceback (most recent call last):\n" +- " File \"test.py\", line X, in test_failing\n" +- " self.assertEqual(1, 2)\n" +- "AssertionError: 1 != 2\n" +- "\n" +- "Foo\n" +- "Baz\n" ++ "Foo\n" + ++ "Traceback (most recent call last):\n" + ++ " File \"test.py\", line X, in test_failing\n" + ++ " self.assertEqual(1, 2)\n" + ++ ( ++ " ~~~~~~~~~~~~~~~~^^^^^^\n" if sys.version_info >= (3,13,) else "" ++ ) + ++ "AssertionError: 1 != 2\n" + ++ "\n" + ++ "Foo\n" + ++ "Baz\n" + + "Bar\n" + ) + ) +@@ -264,18 +276,21 @@ class TAPTestRunnerTest(unittest.TestCase): + ) + self.assertEqual( + self.process_output(self.output_stream.getvalue()), ( +- "TAP version 13\n" +- "Foo\n" +- "Traceback (most recent call last):\n" +- " File \"test.py\", line X, in test_failing\n" +- " self.assertEqual(1, 2)\n" +- "AssertionError: 1 != 2\n" +- "\n" +- "not ok 1 __main__.TAPTestRunnerTest.OutputTest.test_failing\n" +- "Foo\n" +- "Baz\n" +- "Bar\n" +- "ok 2 __main__.TAPTestRunnerTest.OutputTest.test_passing\n" ++ "TAP version 13\n" + ++ "Foo\n" + ++ "Traceback (most recent call last):\n" + ++ " File \"test.py\", line X, in test_failing\n" + ++ " self.assertEqual(1, 2)\n" + ++ ( ++ " ~~~~~~~~~~~~~~~~^^^^^^\n" if sys.version_info >= (3,13,) else "" ++ ) + ++ "AssertionError: 1 != 2\n" + ++ "\n" + ++ "not ok 1 __main__.TAPTestRunnerTest.OutputTest.test_failing\n" + ++ "Foo\n" + ++ "Baz\n" + ++ "Bar\n" + ++ "ok 2 __main__.TAPTestRunnerTest.OutputTest.test_passing\n" + + "1..2\n" + ) + ) +@@ -288,20 +303,23 @@ class TAPTestRunnerTest(unittest.TestCase): + ) + self.assertEqual( + self.process_output(self.output_stream.getvalue()), ( +- "TAP version 13\n" +- "not ok 1 __main__.TAPTestRunnerTest.OutputTest.test_failing\n" +- "# Foo\n" +- " ---\n" +- " message: |\n" +- " Traceback (most recent call last):\n" +- " File \"test.py\", line X, in test_failing\n" +- " self.assertEqual(1, 2)\n" +- " AssertionError: 1 != 2\n" +- " ...\n" +- "ok 2 __main__.TAPTestRunnerTest.OutputTest.test_passing\n" +- "# Foo\n" +- "# Baz\n" +- "# Bar\n" ++ "TAP version 13\n" + ++ "not ok 1 __main__.TAPTestRunnerTest.OutputTest.test_failing\n" + ++ "# Foo\n" + ++ " ---\n" + ++ " message: |\n" + ++ " Traceback (most recent call last):\n" + ++ " File \"test.py\", line X, in test_failing\n" + ++ " self.assertEqual(1, 2)\n" + ++ ( ++ " ~~~~~~~~~~~~~~~~^^^^^^\n" if sys.version_info >= (3,13,) else "" ++ ) + ++ " AssertionError: 1 != 2\n" + ++ " ...\n" + ++ "ok 2 __main__.TAPTestRunnerTest.OutputTest.test_passing\n" + ++ "# Foo\n" + ++ "# Baz\n" + ++ "# Bar\n" + + "1..2\n" + ) + ) +-- +2.48.1 + diff --git a/dev-python/pycotap/metadata.xml b/dev-python/pycotap/metadata.xml new file mode 100644 index 000000000000..dfbdfa5c9fdb --- /dev/null +++ b/dev-python/pycotap/metadata.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>python@gentoo.org</email> + </maintainer> + <maintainer type="person" proxied="yes"> + <email>parona@protonmail.com</email> + <name>Alfred Wingate</name> + </maintainer> + <maintainer type="project" proxied="proxy"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <stabilize-allarches/> + <upstream> + <remote-id type="github">remko/pycotap</remote-id> + <remote-id type="pypi">pycotap</remote-id> + </upstream> +</pkgmetadata> diff --git a/dev-python/pycotap/pycotap-1.3.1.ebuild b/dev-python/pycotap/pycotap-1.3.1.ebuild new file mode 100644 index 000000000000..2ad2d92cc89e --- /dev/null +++ b/dev-python/pycotap/pycotap-1.3.1.ebuild @@ -0,0 +1,38 @@ +# Copyright 2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..13} ) + +inherit distutils-r1 pypi + +DESCRIPTION="A tiny test runner that outputs TAP results to standard output" +HOMEPAGE=" + https://github.com/remko/pycotap/ + https://pypi.org/project/pycotap/ +" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~riscv ~x86" + +PATCHES=( + "${FILESDIR}"/pycotap-1.3.1-fix-python3.13-tests.patch +) + +distutils_enable_tests unittest + +python_prepare_all() { + distutils-r1_python_prepare_all + + sed -i -e "/data_files =/d" setup.py || die + + # Fixup test output assumptions for unittest + sed -i -e 's/__main__\.TAPTestRunnerTest/test.TAPTestRunnerTest/' test/test.py || die +} + +python_test() { + eunittest test +} |