From 0efee0f7e419dd4e7d4fcce9b17b837eb9d682a9 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Tue, 27 Dec 2022 22:06:30 +0100 Subject: 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). --- testtools/tests/test_distutilscmd.py | 4 ++-- 1 file 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} -- cgit v1.2.1