1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s4:dsdb:tests: Use loadTestsFromTestCase() instead of makeSuite()

makeSuite() is deprecated and will be removed in Python 3.13.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joseph Sutton 2023-10-02 15:07:54 +13:00 committed by Andrew Bartlett
parent bb77f36f49
commit 9e3a858969
8 changed files with 16 additions and 8 deletions

View File

@ -515,7 +515,8 @@ if "://" not in host:
if ANCIENT_SAMBA: if ANCIENT_SAMBA:
runner = SubunitTestRunner() runner = SubunitTestRunner()
if not runner.run(unittest.makeSuite(UserTests)).wasSuccessful(): if not runner.run(unittest.TestLoader().loadTestsFromTestCase(
UserTests)).wasSuccessful():
sys.exit(1) sys.exit(1)
sys.exit(0) sys.exit(0)
else: else:

View File

@ -80,7 +80,8 @@ if "://" not in host:
if ANCIENT_SAMBA: if ANCIENT_SAMBA:
runner = SubunitTestRunner() runner = SubunitTestRunner()
if not runner.run(unittest.makeSuite(UserTests)).wasSuccessful(): if not runner.run(unittest.TestLoader().loadTestsFromTestCase(
UserTests)).wasSuccessful():
sys.exit(1) sys.exit(1)
sys.exit(0) sys.exit(0)
else: else:

View File

@ -332,7 +332,8 @@ if "://" not in host:
if ANCIENT_SAMBA: if ANCIENT_SAMBA:
runner = SubunitTestRunner() runner = SubunitTestRunner()
if not runner.run(unittest.makeSuite(UserTests)).wasSuccessful(): if not runner.run(unittest.TestLoader().loadTestsFromTestCase(
UserTests)).wasSuccessful():
sys.exit(1) sys.exit(1)
sys.exit(0) sys.exit(0)
else: else:

View File

@ -123,7 +123,8 @@ if "://" not in host:
if ANCIENT_SAMBA: if ANCIENT_SAMBA:
runner = SubunitTestRunner() runner = SubunitTestRunner()
if not runner.run(unittest.makeSuite(UserTests)).wasSuccessful(): if not runner.run(unittest.TestLoader().loadTestsFromTestCase(
UserTests)).wasSuccessful():
sys.exit(1) sys.exit(1)
sys.exit(0) sys.exit(0)
else: else:

View File

@ -288,7 +288,8 @@ if "://" not in host:
if ANCIENT_SAMBA: if ANCIENT_SAMBA:
runner = SubunitTestRunner() runner = SubunitTestRunner()
if not runner.run(unittest.makeSuite(UserTests)).wasSuccessful(): if not runner.run(unittest.TestLoader().loadTestsFromTestCase(
UserTests)).wasSuccessful():
sys.exit(1) sys.exit(1)
sys.exit(0) sys.exit(0)
else: else:

View File

@ -214,7 +214,8 @@ if "://" not in host:
if ANCIENT_SAMBA: if ANCIENT_SAMBA:
runner = SubunitTestRunner() runner = SubunitTestRunner()
if not runner.run(unittest.makeSuite(UserTests)).wasSuccessful(): if not runner.run(unittest.TestLoader().loadTestsFromTestCase(
UserTests)).wasSuccessful():
sys.exit(1) sys.exit(1)
sys.exit(0) sys.exit(0)
else: else:

View File

@ -386,6 +386,7 @@ class PrivAttrsTests(samba.tests.TestCase):
runner = SubunitTestRunner() runner = SubunitTestRunner()
rc = 0 rc = 0
if not runner.run(unittest.makeSuite(PrivAttrsTests)).wasSuccessful(): if not runner.run(unittest.TestLoader().loadTestsFromTestCase(
PrivAttrsTests)).wasSuccessful():
rc = 1 rc = 1
sys.exit(rc) sys.exit(rc)

View File

@ -1292,6 +1292,7 @@ class UserAccountControlTests(samba.tests.TestCase):
runner = SubunitTestRunner() runner = SubunitTestRunner()
rc = 0 rc = 0
if not runner.run(unittest.makeSuite(UserAccountControlTests)).wasSuccessful(): if not runner.run(unittest.TestLoader().loadTestsFromTestCase(
UserAccountControlTests)).wasSuccessful():
rc = 1 rc = 1
sys.exit(rc) sys.exit(rc)