summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Goirand <zigo@debian.org>2022-12-27 22:06:30 +0100
committerThomas Goirand <zigo@debian.org>2022-12-27 22:06:30 +0100
commit0efee0f7e419dd4e7d4fcce9b17b837eb9d682a9 (patch)
tree416d1dfe76b51e411bd5fc5e5b5be97a15b1be77
parent2fc09e4f64e51148d1245b287dec84717a0f353a (diff)
downloadtesttools-0efee0f7e419dd4e7d4fcce9b17b837eb9d682a9.tar.gz
Fix distutilscmd in Debian + Py 3.11
Under Debian, when attempting to run tests, the debian folder is found and conflicts with this error: setuptools.errors.PackageDiscoveryError: Multiple top-level packages discovered in a flat-layout: ['debian', 'testtools']. This patch fixes this (I already applied it in Debian, and it solved the issue for me).
-rw-r--r--testtools/tests/test_distutilscmd.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/testtools/tests/test_distutilscmd.py b/testtools/tests/test_distutilscmd.py
index 8ef197c..29c35d0 100644
--- a/testtools/tests/test_distutilscmd.py
+++ b/testtools/tests/test_distutilscmd.py
@@ -50,7 +50,7 @@ class TestCommandTest(TestCase):
def test_test_module(self):
self.useFixture(SampleTestFixture())
stdout = self.useFixture(fixtures.StringStream('stdout'))
- dist = Distribution()
+ dist = Distribution(attrs={ 'packages': ['testtools'] })
dist.script_name = 'setup.py'
dist.script_args = ['test']
dist.cmdclass = {'test': TestCommand}
@@ -70,7 +70,7 @@ OK
def test_test_suite(self):
self.useFixture(SampleTestFixture())
stdout = self.useFixture(fixtures.StringStream('stdout'))
- dist = Distribution()
+ dist = Distribution(attrs={ 'packages': ['testtools'] })
dist.script_name = 'setup.py'
dist.script_args = ['test']
dist.cmdclass = {'test': TestCommand}