remove all references to optparse (deprecated since Python 3.2)

This commit is contained in:
Hans-Christoph Steiner 2024-05-02 14:08:28 +02:00
parent 717df09be0
commit 1e5699e90c
24 changed files with 115 additions and 93 deletions

View file

@ -3,7 +3,6 @@
# http://www.drdobbs.com/testing/unit-testing-with-python/240165163
import logging
import optparse
import os
import sys
import unittest
@ -336,15 +335,17 @@ class CheckupdatesTest(unittest.TestCase):
if __name__ == "__main__":
parser = optparse.OptionParser()
parser.add_option(
import argparse
parser = argparse.ArgumentParser()
parser.add_argument(
"-v",
"--verbose",
action="store_true",
default=False,
help="Spew out even more information than normal",
)
(fdroidserver.common.options, args) = parser.parse_args(['--verbose'])
fdroidserver.common.options = parser.parse_args(['--verbose'])
newSuite = unittest.TestSuite()
newSuite.addTest(unittest.makeSuite(CheckupdatesTest))