mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-11 16:13:21 -04:00
dev-python/testrepository: initial import
Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
This commit is contained in:
1
dev-python/testrepository/Manifest
Normal file
1
dev-python/testrepository/Manifest
Normal file
@@ -0,0 +1 @@
|
||||
DIST testrepository-0.0.20.tar.gz 84956 BLAKE2B 9b9a8e0c21754fe8ba019b58024f137e72b4341cb368fb48dc48039f512b232ca4f03f16c2596aa34b428d69097db939e5776417a7d26f5a8508c8f0c1f1a5bf SHA512 df14500e2b27b6f39d9d4c4f42961efd63dfe25186e561eb1678952a8ab9311f17c36b78819fea33e0ac879c47a33d45c31ff58be017609c8a6157905ee712d6
|
||||
@@ -0,0 +1,62 @@
|
||||
From 8f8ab15fafdad6db850c84772323b32375b09285 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Collins <robertc@robertcollins.net>
|
||||
Date: Tue, 10 Mar 2015 15:21:49 +1300
|
||||
Subject: [PATCH] Fixup tests with latest testtools.
|
||||
|
||||
Testtools has started chunking exceptions (which is perhaps good,
|
||||
perhaps bad) - but we shouldn't depend on the exact behaviour in it
|
||||
for our tests.
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -5,6 +5,12 @@ testrepository release notes
|
||||
NEXT (In development)
|
||||
+++++++++++++++++++++
|
||||
|
||||
+CHANGES
|
||||
+-------
|
||||
+
|
||||
+* Isolate the testrepository test suite from the chunking (or otherwise)
|
||||
+ behaviour of testtools' exception handlers. (Robert Collins)
|
||||
+
|
||||
0.0.20
|
||||
++++++
|
||||
|
||||
--- a/testrepository/tests/test_repository.py
|
||||
+++ b/testrepository/tests/test_repository.py
|
||||
@@ -28,6 +28,7 @@
|
||||
from testresources import TestResource
|
||||
from testtools import (
|
||||
clone_test_with_new_id,
|
||||
+ content,
|
||||
PlaceHolder,
|
||||
)
|
||||
import testtools
|
||||
@@ -103,19 +104,24 @@ class Case(ResourcedTestCase):
|
||||
def passing(self):
|
||||
pass
|
||||
|
||||
- def failing(self):
|
||||
- self.fail("oops")
|
||||
-
|
||||
def unexpected_success(self):
|
||||
self.expectFailure("unexpected success", self.assertTrue, True)
|
||||
|
||||
|
||||
+class FailingCase:
|
||||
+
|
||||
+ def run(self, result):
|
||||
+ result.startTest(self)
|
||||
+ result.addError(
|
||||
+ self, None, details={'traceback': content.text_content("")})
|
||||
+ result.stopTest(self)
|
||||
+
|
||||
def make_test(id, should_pass):
|
||||
"""Make a test."""
|
||||
if should_pass:
|
||||
case = Case("passing")
|
||||
else:
|
||||
- case = Case("failing")
|
||||
+ case = FailingCase()
|
||||
return clone_test_with_new_id(case, id)
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
From d3d6cac4fd42f2067c0dd81be748853f81c348fc Mon Sep 17 00:00:00 2001
|
||||
From: Robert Collins <robertc@robertcollins.net>
|
||||
Date: Sun, 12 Jul 2015 21:37:34 +1200
|
||||
Subject: [PATCH] Fix 3.3+ tests with nested classnames.
|
||||
|
||||
--- a/testrepository/tests/ui/test_cli.py
|
||||
+++ b/testrepository/tests/ui/test_cli.py
|
||||
@@ -157,7 +157,7 @@ def method(self):
|
||||
self.assertThat(ui._stdout.buffer.getvalue().decode('utf8'),
|
||||
DocTestMatches("""\
|
||||
======================================================================
|
||||
-FAIL: testrepository.tests.ui.test_cli.Case.method
|
||||
+FAIL: testrepository.tests.ui.test_cli...Case.method
|
||||
----------------------------------------------------------------------
|
||||
...Traceback (most recent call last):...
|
||||
File "...test_cli.py", line ..., in method
|
||||
@@ -0,0 +1,49 @@
|
||||
From e2f84ae6b2bcf89221613056d0c45dd308f46d62 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= <jelmer@jelmer.uk>
|
||||
Date: Thu, 5 Apr 2018 01:02:40 +0100
|
||||
Subject: [PATCH] Fix the testrepository tests with newer versions of
|
||||
testtools.
|
||||
|
||||
--- a/testrepository/tests/commands/test_failing.py
|
||||
+++ b/testrepository/tests/commands/test_failing.py
|
||||
@@ -90,7 +90,7 @@ class TestCommand(ResourcedTestCase):
|
||||
finally:
|
||||
log.stopTestRun()
|
||||
self.assertEqual(
|
||||
- log._events, [
|
||||
+ [tuple(ev) for ev in log._events], [
|
||||
('startTestRun',),
|
||||
('status', 'failing', 'inprogress', None, True, None, None, False,
|
||||
None, None, Wildcard),
|
||||
--- a/testrepository/tests/test_repository.py
|
||||
+++ b/testrepository/tests/test_repository.py
|
||||
@@ -113,9 +113,10 @@ class FailingCase:
|
||||
def run(self, result):
|
||||
result.startTest(self)
|
||||
result.addError(
|
||||
- self, None, details={'traceback': content.text_content("")})
|
||||
+ self, None, details={'traceback': content.text_content("tb")})
|
||||
result.stopTest(self)
|
||||
|
||||
+
|
||||
def make_test(id, should_pass):
|
||||
"""Make a test."""
|
||||
if should_pass:
|
||||
@@ -409,7 +410,7 @@ class TestRepositoryContract(ResourcedTestCase):
|
||||
finally:
|
||||
log.stopTestRun()
|
||||
self.assertEqual(
|
||||
- log._events, [
|
||||
+ [tuple(ev) for ev in log._events], [
|
||||
('startTestRun',),
|
||||
('status',
|
||||
'testrepository.tests.test_repository.Case.method',
|
||||
@@ -465,7 +466,7 @@ class TestRepositoryContract(ResourcedTestCase):
|
||||
finally:
|
||||
log.stopTestRun()
|
||||
self.assertEqual(
|
||||
- log._events,
|
||||
+ [tuple(ev) for ev in log._events],
|
||||
[
|
||||
('startTestRun',),
|
||||
('status',
|
||||
14
dev-python/testrepository/metadata.xml
Normal file
14
dev-python/testrepository/metadata.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<description>Comaintainers welcome</description>
|
||||
<email>lssndrbarbieri@gmail.com</email>
|
||||
<name>Alessandro Barbieri</name>
|
||||
</maintainer>
|
||||
<upstream>
|
||||
<remote-id type="github">testing-cabal/testrepository</remote-id>
|
||||
<remote-id type="pypi">testrepository</remote-id>
|
||||
<remote-id type="launchpad">testrepository</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
106
dev-python/testrepository/testrepository-0.0.20-r200.ebuild
Normal file
106
dev-python/testrepository/testrepository-0.0.20-r200.ebuild
Normal file
@@ -0,0 +1,106 @@
|
||||
# Copyright 1999-2021 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
# Required for test phase
|
||||
DISTUTILS_IN_SOURCE_BUILD=1
|
||||
EPYTEST_DESELECT=(
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_can_get_inserter
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_can_initialise_with_param
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_count
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_get_failing_complete_runs_delete_missing_failures
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_get_failing_empty
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_get_failing_get_id
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_get_failing_get_subunit_stream
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_get_failing_one_run
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_get_failing_partial_runs_preserve_missing_failures
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_get_latest_run
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_get_latest_run_empty_repo
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_get_subunit_from_test_run
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_get_test_from_test_run
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_get_test_ids
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_get_test_run
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_get_test_run_get_id
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_get_test_run_missing_keyerror
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_get_times_unknown_tests_are_unknown
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_insert_stream_smoke
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_inserted_exists_no_impact_on_test_times
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_inserted_test_times_known
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_inserting_creates_id
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_latest_id_empty
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_latest_id_nonempty
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_open
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_open_non_existent
|
||||
testrepository/tests/test_repository.py::TestRepositoryContract::test_unexpected_success
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_args_are_exposed_at_arguments
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_exec_subprocess
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_factory_input_stream_args
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_factory_noargs
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_here
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_iter_streams_load_stdin_use_case
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_iter_streams_unexpected_type_raises
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_make_result
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_make_result_previous_run
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_options_at_options
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_options_on_command_picked_up
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_options_when_set_at_options
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_output_error
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_output_rest
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_output_stream
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_output_stream_non_utf8
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_output_summary
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_output_table
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_output_tests
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_output_values
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_set_command
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_set_command_checks_args_invalid_arg
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_set_command_checks_args_missing_arg
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_set_command_checks_args_unwanted_arg
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_set_command_with_no_name_works
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_subprocesses_have_stdin
|
||||
testrepository/tests/test_ui.py::TestUIContract::test_subprocesses_have_stdout
|
||||
testrepository/tests/commands/test_run.py::TestReturnCodeToSubunit::test_returncode_0_no_change
|
||||
testrepository/tests/commands/test_run.py::TestReturnCodeToSubunit::test_returncode_nonzero_fail_appended_to_content
|
||||
testrepository/tests/ui/test_cli.py::TestCLIUI::test_dash_dash_help_shows_help
|
||||
)
|
||||
PYTHON_COMPAT=( python3_8 )
|
||||
PYTHON_REQ_USE="threads(+)"
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="A repository of test results"
|
||||
HOMEPAGE="
|
||||
https://launchpad.net/testrepository
|
||||
https://pypi.org/project/testrepository
|
||||
https://github.com/testing-cabal/testrepository
|
||||
"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
LICENSE="Apache-2.0 BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
|
||||
RDEPEND="
|
||||
>=dev-python/subunit-0.0.18[${PYTHON_USEDEP}]
|
||||
>=dev-python/testtools-0.9.30[${PYTHON_USEDEP}]
|
||||
dev-python/fixtures[${PYTHON_USEDEP}]
|
||||
"
|
||||
#bzr is listed but presumably req'd for a live repo test run
|
||||
DEPEND="
|
||||
${RDEPEND}
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]
|
||||
test? (
|
||||
dev-python/testresources[${PYTHON_USEDEP}]
|
||||
dev-python/testscenarios[${PYTHON_USEDEP}]
|
||||
dev-python/pytz[${PYTHON_USEDEP}]
|
||||
)
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${P}-test-backport.patch"
|
||||
"${FILESDIR}/${P}-test-backport1.patch"
|
||||
"${FILESDIR}/${P}-test-backport2.patch"
|
||||
)
|
||||
|
||||
distutils_enable_tests pytest
|
||||
Reference in New Issue
Block a user