kopia lustrzana https://github.com/wagtail/wagtail
Use parse_known_args so we can handle extra testrunner named parameters
rodzic
a789ec7b7f
commit
fa853de486
|
@ -256,6 +256,7 @@ Contributors
|
|||
* Anselm Bradford
|
||||
* Mads Jensen
|
||||
* Samir Shah
|
||||
* Patrick Woods
|
||||
|
||||
Translators
|
||||
===========
|
||||
|
|
|
@ -20,16 +20,15 @@ def make_parser():
|
|||
parser.add_argument('--elasticsearch', action='store_true')
|
||||
parser.add_argument('--elasticsearch2', action='store_true')
|
||||
parser.add_argument('--elasticsearch5', action='store_true')
|
||||
parser.add_argument('rest', nargs='*')
|
||||
return parser
|
||||
|
||||
|
||||
def parse_args(args=None):
|
||||
return make_parser().parse_args(args)
|
||||
return make_parser().parse_known_args(args)
|
||||
|
||||
|
||||
def runtests():
|
||||
args = parse_args()
|
||||
args, rest = parse_args()
|
||||
|
||||
only_wagtail = r'^wagtail(\.|$)'
|
||||
if args.deprecation == 'all':
|
||||
|
@ -66,7 +65,7 @@ def runtests():
|
|||
# forcibly delete the ELASTICSEARCH_URL setting to skip those tests
|
||||
del os.environ['ELASTICSEARCH_URL']
|
||||
|
||||
argv = [sys.argv[0], 'test'] + args.rest
|
||||
argv = [sys.argv[0], 'test'] + rest
|
||||
try:
|
||||
execute_from_command_line(argv)
|
||||
finally:
|
||||
|
|
Ładowanie…
Reference in New Issue