Skip to content

Commit

Permalink
fixing pep/docstring for contextmanager
Browse files Browse the repository at this point in the history
  • Loading branch information
lockefox committed Apr 12, 2018
1 parent 655f4d7 commit 4e44079
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions prosper/test_utils/schema_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,26 @@ class MongoContextManager:
Args:
config (:obj:`prosper.common.prosper_config.ProsperConfig`): configparser-like object
# username (str): MongoDB Username
# password (str): MongoDB Password
database (str): which database to connect to
# connection_str (str): connection string to platform
config_key (str): section name for ConfigParser
log_key (str): name of logger to attach to
"""

def __init__(self, config, database, config_key='MONGODB', log_key=_version.__library_name__):
def __init__(
self,
config,
database,
config_key='MONGODB',
log_key='PROSPER__' + _version.__library_name__
):
self.username = config.get_option(config_key, 'username')
self.password = config.get_option(config_key, 'password')
self.database = database
self.connection_string = config.get_option(config_key, 'connection_string')
self._testmode = False
self._testmode_filepath = pathlib.Path(__file__).parent / 'testdb.json'
self.logger = logging.getLogger('PROSPER__test_helper')
self.logger = logging.getLogger(log_key)
# TODO: validate {} in connection_str

def __get_connector(self):
Expand Down

0 comments on commit 4e44079

Please sign in to comment.