Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

Commit

Permalink
chore(test_runner): Deleted obsolete initArgumentParser()
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Wiseblatt committed Jan 2, 2019
1 parent 05d26c0 commit dacf88e
Showing 1 changed file with 1 addition and 33 deletions.
34 changes: 1 addition & 33 deletions citest/base/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def default_binding_overrides(self):
The purpose of this dictionary is to provide default values when adding
argumentParser arguments. This dictionary is passed to the
initArgumentParser method in the BaseTestCase when initializing the
init_bindings_builder method in the BaseTestCase when initializing the
ArgumentParser. Programs can use this to inject the default submodule
values they'd like to override.
"""
Expand Down Expand Up @@ -410,38 +410,6 @@ def init_bindings_builder(self, builder, defaults=None):
' https://docs.python.org/2/library/logging.config.html'
'#logging-config-dictschema')

def initArgumentParser(self, parser, defaults=None):
"""Adds arguments introduced by the TestRunner module.
Args:
parser: argparse.ArgumentParser instance to add to.
"""
print('{} called DEPRECATED initArgumentParser\n'
'Use init_bindings_builder instead.'
.format(self.__class__.__name__))

# Normally we want the log file name to reflect the name of the program
# we are running, but we might not be running one (e.g. in interpreter).
try:
basename = os.path.basename(sys.argv[0])
main_filename = os.path.splitext(basename)[0]
except IndexError:
main_filename = 'debug'

defaults = defaults or {}
parser.add_argument('--log_dir', default=defaults.get('LOG_DIR', '.'))
parser.add_argument('--log_filebase',
default=defaults.get('LOG_FILEBASE', main_filename))
parser.add_argument(
'--log_config', default=defaults.get('LOG_CONFIG', ''),
help='Path to text file containing custom logging configuration. The'
' contents of this path can contain variable references in the form'
' $KEY where --KEY is a command-line argument that whose value should'
' be substituted. Otherwise this is a standard python logging'
' configuration schema as described in'
' https://docs.python.org/2/library/logging.config.html'
'#logging-config-dictschema')

def start_logging(self):
"""Setup default logging from the citest.base.log_config parameter."""
text = _DEFAULT_LOG_CONFIG
Expand Down

0 comments on commit dacf88e

Please sign in to comment.