diff --git a/PKG-INFO b/PKG-INFO index 3606f8a..c56a078 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,28 +1,28 @@ Metadata-Version: 2.1 Name: swh.core -Version: 0.0.52 +Version: 0.0.53 Summary: Software Heritage core utilities Home-page: https://forge.softwareheritage.org/diffusion/DCORE/ Author: Software Heritage developers Author-email: swh-devel@inria.fr License: UNKNOWN -Project-URL: Source, https://forge.softwareheritage.org/source/swh-core -Project-URL: Funding, https://www.softwareheritage.org/donate Project-URL: Bug Reports, https://forge.softwareheritage.org/maniphest +Project-URL: Funding, https://www.softwareheritage.org/donate +Project-URL: Source, https://forge.softwareheritage.org/source/swh-core Description: swh-core ======== core library for swh's modules: - config parser - hash computations - serialization - logging mechanism Platform: UNKNOWN Classifier: Programming Language :: Python :: 3 Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3) Classifier: Operating System :: OS Independent Classifier: Development Status :: 5 - Production/Stable Description-Content-Type: text/markdown Provides-Extra: testing diff --git a/swh.core.egg-info/PKG-INFO b/swh.core.egg-info/PKG-INFO index 3606f8a..c56a078 100644 --- a/swh.core.egg-info/PKG-INFO +++ b/swh.core.egg-info/PKG-INFO @@ -1,28 +1,28 @@ Metadata-Version: 2.1 Name: swh.core -Version: 0.0.52 +Version: 0.0.53 Summary: Software Heritage core utilities Home-page: https://forge.softwareheritage.org/diffusion/DCORE/ Author: Software Heritage developers Author-email: swh-devel@inria.fr License: UNKNOWN -Project-URL: Source, https://forge.softwareheritage.org/source/swh-core -Project-URL: Funding, https://www.softwareheritage.org/donate Project-URL: Bug Reports, https://forge.softwareheritage.org/maniphest +Project-URL: Funding, https://www.softwareheritage.org/donate +Project-URL: Source, https://forge.softwareheritage.org/source/swh-core Description: swh-core ======== core library for swh's modules: - config parser - hash computations - serialization - logging mechanism Platform: UNKNOWN Classifier: Programming Language :: Python :: 3 Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3) Classifier: Operating System :: OS Independent Classifier: Development Status :: 5 - Production/Stable Description-Content-Type: text/markdown Provides-Extra: testing diff --git a/swh/core/tests/test_logger.py b/swh/core/tests/test_logger.py index 240aac1..3d00693 100644 --- a/swh/core/tests/test_logger.py +++ b/swh/core/tests/test_logger.py @@ -1,50 +1,51 @@ -# Copyright (C) 2015 The Software Heritage developers +# Copyright (C) 2015-2018 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information import logging import os import pytest from swh.core.logger import PostgresHandler from swh.core.tests import SQL_DIR DUMP_FILE = os.path.join(SQL_DIR, 'log-schema.sql') @pytest.fixture def swh_db_logger(postgresql_proc, postgresql): cursor = postgresql.cursor() with open(DUMP_FILE) as fobj: cursor.execute(fobj.read()) postgresql.commit() modname = 'swh.core.tests.test_logger' logger = logging.Logger(modname, logging.DEBUG) dsn = 'postgresql://{user}@{host}:{port}/{dbname}'.format( host=postgresql_proc.host, port=postgresql_proc.port, user='postgres', dbname='tests') logger.addHandler(PostgresHandler(dsn)) return logger +@pytest.mark.db def test_log(swh_db_logger, postgresql): logger = swh_db_logger modname = logger.name logger.info('notice', extra={'swh_type': 'test entry', 'swh_data': 42}) logger.warning('warning') with postgresql.cursor() as cur: cur.execute('SELECT level, message, data, src_module FROM log') db_log_entries = cur.fetchall() assert ('info', 'notice', {'type': 'test entry', 'data': 42}, modname) in db_log_entries assert ('warning', 'warning', {}, modname) in db_log_entries diff --git a/version.txt b/version.txt index d3b4764..1c348f9 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v0.0.52-0-gf3efe0c \ No newline at end of file +v0.0.53-0-g993625f \ No newline at end of file