Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
python-testscenarios (0.5.0-6) unstable; urgency=medium

* Add testtools-2.8.2-compat.patch (Closes: #1124202).
* Add fix-assertEquals-is-removed.patch.

-- Thomas Goirand <[email protected]> Mon, 29 Dec 2025 10:50:33 +0100

python-testscenarios (0.5.0-5) unstable; urgency=medium

* Add missing pbr (build-)depends (Closes: #1099276).

-- Thomas Goirand <[email protected]> Mon, 03 Mar 2025 16:09:49 +0100

python-testscenarios (0.5.0-4) unstable; urgency=medium

* Add extend-diff-ignore to ignore egg-info (Closes: #1045636).

-- Thomas Goirand <[email protected]> Tue, 15 Aug 2023 15:50:10 +0200

python-testscenarios (0.5.0-3) unstable; urgency=medium

[ Mattia Rizzolo ]
Expand Down
2 changes: 2 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Build-Depends:
dh-python,
openstack-pkg-tools (>= 99~),
python3-all,
python3-pbr,
python3-setuptools,
python3-testtools,
Standards-Version: 4.2.0
Expand All @@ -19,6 +20,7 @@ Homepage: https://launchpad.net/testscenarios
Package: python3-testscenarios
Architecture: all
Depends:
python3-pbr,
python3-testtools,
${misc:Depends},
${python3:Depends},
Expand Down
26 changes: 26 additions & 0 deletions debian/patches/fix-assertEquals-is-removed.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Description: Fix assertEquals is removed
Author: Thomas Goirand <[email protected]>
Bug-Debian: https://bugs.debian.org/1124202
Forwarded: no
Last-Update: 2025-12-29

--- python-testscenarios-0.5.0.orig/testscenarios/tests/test_scenarios.py
+++ python-testscenarios-0.5.0/testscenarios/tests/test_scenarios.py
@@ -193,7 +193,7 @@ class TestLoadTests(testtools.TestCase):
[self.SampleTest('test_nothing')],
None)
result_tests = list(testtools.iterate_tests(suite))
- self.assertEquals(
+ self.assertEqual(
2,
len(result_tests),
result_tests)
@@ -206,7 +206,7 @@ class TestLoadTests(testtools.TestCase):
unittest.TestLoader(),
)
result_tests = list(testtools.iterate_tests(suite))
- self.assertEquals(
+ self.assertEqual(
2,
len(result_tests),
result_tests)
2 changes: 2 additions & 0 deletions debian/patches/series
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
fix-Makefile-to-use-py3.patch
testtools-2.8.2-compat.patch
fix-assertEquals-is-removed.patch
94 changes: 94 additions & 0 deletions debian/patches/testtools-2.8.2-compat.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
Description: Fix compatibility with newer testtools
These no longer provide testtools.tests
Author: Jelmer Vernooij <[email protected]>
Origin: upstream, https://github.com/testing-cabal/testscenarios/commit/75b76e7d07bc6d415384e668aefb6b887a3aa13d
Bug-Debian: https://bugs.debian.org/1124202
Date: Mon, 22 Dec 2025 20:10:49 +0000

Index: python-testscenarios/testscenarios/tests/test_testcase.py
===================================================================
--- python-testscenarios.orig/testscenarios/tests/test_testcase.py
+++ python-testscenarios/testscenarios/tests/test_testcase.py
@@ -18,10 +18,68 @@ import unittest

import testtools
from testtools.matchers import EndsWith
-from testtools.tests.helpers import LoggingResult

import testscenarios

+class LoggingResult(testtools.TestResult):
+ """TestResult that logs its event to a list."""
+
+ def __init__(self, log):
+ self._events = log
+ super().__init__()
+
+ def startTest(self, test):
+ self._events.append(("startTest", test))
+ super().startTest(test)
+
+ def stop(self):
+ self._events.append("stop")
+ super().stop()
+
+ def stopTest(self, test):
+ self._events.append(("stopTest", test))
+ super().stopTest(test)
+
+ def addFailure(self, test, err=None, details=None):
+ self._events.append(("addFailure", test, err))
+ super().addFailure(test, err, details)
+
+ def addError(self, test, err=None, details=None):
+ self._events.append(("addError", test, err))
+ super().addError(test, err, details)
+
+ def addSkip(self, test, reason=None, details=None):
+ # Extract reason from details if not provided directly
+ if reason is None and details and "reason" in details:
+ reason = details["reason"].as_text()
+ self._events.append(("addSkip", test, reason))
+ super().addSkip(test, reason, details)
+
+ def addSuccess(self, test, details=None):
+ self._events.append(("addSuccess", test))
+ super().addSuccess(test, details)
+
+ def startTestRun(self):
+ self._events.append("startTestRun")
+ super().startTestRun()
+
+ def stopTestRun(self):
+ self._events.append("stopTestRun")
+ super().stopTestRun()
+
+ def done(self):
+ self._events.append("done")
+ super().done()
+
+ def tags(self, new_tags, gone_tags):
+ self._events.append(("tags", new_tags, gone_tags))
+ super().tags(new_tags, gone_tags)
+
+ def time(self, a_datetime):
+ self._events.append(("time", a_datetime))
+ super().time(a_datetime)
+
+
class TestTestWithScenarios(testtools.TestCase):

scenarios = testscenarios.scenarios.per_module_scenarios(
Index: python-testscenarios/testscenarios/tests/test_scenarios.py
===================================================================
--- python-testscenarios.orig/testscenarios/tests/test_scenarios.py
+++ python-testscenarios/testscenarios/tests/test_scenarios.py
@@ -20,7 +20,7 @@ import unittest
import testtools
from testtools.matchers import EndsWith

-from testtools.tests.helpers import LoggingResult
+from testscenarios.tests.test_testcase import LoggingResult

import testscenarios
from testscenarios.scenarios import (
1 change: 1 addition & 0 deletions debian/source/options
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extend-diff-ignore = "^[^/]*[.]egg-info/"
Loading