[Python-modules-commits] [pytest-catchlog] 01/12: Import pytest-catchlog_1.2.2.orig.tar.xz
Daniel Stender
danstender-guest at moszumanska.debian.org
Fri Mar 18 11:01:17 UTC 2016
This is an automated email from the git hooks/post-receive script.
danstender-guest pushed a commit to branch master
in repository pytest-catchlog.
commit be1d0ae882f0f14e9dab5cb085914ee26a71803e
Author: Daniel Stender <stender at debian.org>
Date: Fri Mar 18 11:04:54 2016 +0100
Import pytest-catchlog_1.2.2.orig.tar.xz
---
.travis.yml | 14 ++++++++++++++
CHANGES.rst | 11 +++++++++--
README.rst | 4 ++++
pytest_catchlog.py | 4 ++--
tasks.py | 11 +++++++++--
test_pytest_catchlog.py | 24 ++++++++++++++++++++++++
tox.ini | 4 ++--
7 files changed, 64 insertions(+), 8 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index db995e2..6dcef9e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,3 +18,17 @@ script:
cache:
directories:
- $HOME/.cache/pip/http
+
+deploy:
+ provider: pypi
+ distributions: 'sdist bdist_wheel'
+ on:
+ branch: 'master'
+ tags: true
+ password:
+ secure: >-
+ Yg5m1M3mhezSOdEA2bfQ/0tU4T5/kh9DjH11lvNVZA7QSY4AWp0Ri
+ 38Ea5bk7HP24nlFAXFTrrWr5UJ2ZjdJ/P04tFIWA4yP1H+HU9IF8/
+ 3FSauKjT2uzd0Cy7aP3PB5k2RFNPdtmHqCJr9o5yjAgT74Pv/dM5k
+ t8Qj3h5szdpI=
+ user: 'pytest-catchlog-ci'
diff --git a/CHANGES.rst b/CHANGES.rst
index ed164ab..6e658c0 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -5,10 +5,17 @@ List of notable changes between pytest-catchlog releases.
.. %UNRELEASED_SECTION%
-`Unreleased`_
+`1.2.2`_
-------------
-Yet to be released.
+Released on 2016-01-24 UTC.
+
+- [Bugfix] `#30`_ `#31`_ - Fix ``unicode`` vs ``str`` compatibility issues between Python2 and Python3.
+ (Thanks goes to `@sirex`_ for reporting the issue and providing a fix!)
+
+.. _#30: https://github.com/eisensheng/pytest-catchlog/issues/30
+.. _#31: https://github.com/eisensheng/pytest-catchlog/issues/31
+.. _ at sirex: https://github.com/sirex
`1.2.1`_
diff --git a/README.rst b/README.rst
index bc7fcba..994decb 100644
--- a/README.rst
+++ b/README.rst
@@ -1,6 +1,10 @@
pytest-catchlog
===============
+.. image:: https://badges.gitter.im/Join%20Chat.svg
+ :alt: Join the chat at https://gitter.im/eisensheng/pytest-catchlog
+ :target: https://gitter.im/eisensheng/pytest-catchlog?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
+
py.test plugin to catch log messages. This is a fork of `pytest-capturelog`_.
.. _`pytest-capturelog`: https://pypi.python.org/pypi/pytest-capturelog/
diff --git a/pytest_catchlog.py b/pytest_catchlog.py
index 892fd68..bd86e8b 100644
--- a/pytest_catchlog.py
+++ b/pytest_catchlog.py
@@ -9,7 +9,7 @@ import pytest
import py
-__version__ = '1.2.1'
+__version__ = '1.2.2'
def get_logger_obj(logger=None):
@@ -263,7 +263,7 @@ class CallablePropertyMixin(object):
class CallableList(CallablePropertyMixin, list):
pass
-class CallableStr(CallablePropertyMixin, str):
+class CallableStr(CallablePropertyMixin, py.builtin.text):
pass
diff --git a/tasks.py b/tasks.py
index e271c99..5219c96 100644
--- a/tasks.py
+++ b/tasks.py
@@ -151,8 +151,15 @@ def _patch_change_log(new_version):
if line == u'`Unreleased`_':
return [u'`{}`_'.format(new_version)]
elif line == u'Yet to be released.':
- return [datetime.utcnow().strftime(u'Released on %F.')]
- elif line == u'.. %UNRELEASED_SECTION%':
+ return [datetime.utcnow().strftime(u'Released on %Y-%m-%d UTC.')]
+ return _patch_file(CHANGE_LOG_FILE, __line_callback)
+
+
+ at task(name='changelog-add-stub')
+def changelog_add_stub():
+ """Add new version changes stub to changelog file."""
+ def __line_callback(line):
+ if line == u'.. %UNRELEASED_SECTION%':
return [u'.. %UNRELEASED_SECTION%',
u'',
u'`Unreleased`_',
diff --git a/test_pytest_catchlog.py b/test_pytest_catchlog.py
index b7d6b3b..567a1f3 100644
--- a/test_pytest_catchlog.py
+++ b/test_pytest_catchlog.py
@@ -1,3 +1,7 @@
+# coding: utf-8
+
+import sys
+
import py
pytest_plugins = 'pytester'
@@ -159,6 +163,26 @@ def test_log_access(testdir):
assert result.ret == 0
+def test_unicode(testdir):
+ u = lambda x: x.decode('utf-8') if sys.version_info < (3,) else x
+ testdir.makepyfile(u('''
+ # coding: utf-8
+
+ import sys
+ import logging
+
+ u = lambda x: x.decode('utf-8') if sys.version_info < (3,) else x
+
+ def test_foo(caplog):
+ logging.getLogger().info(u('bū'))
+ assert caplog.records[0].levelname == 'INFO'
+ assert caplog.records[0].msg == u('bū')
+ assert u('bū') in caplog.text
+ '''))
+ result = testdir.runpytest()
+ assert result.ret == 0
+
+
def test_funcarg_help(testdir):
result = testdir.runpytest('--funcargs')
result.stdout.fnmatch_lines(['*caplog*'])
diff --git a/tox.ini b/tox.ini
index ab154e2..eff44fc 100644
--- a/tox.ini
+++ b/tox.ini
@@ -3,7 +3,7 @@ envlist = py{26,27,32,33,34,35}, pypy{,3}
[testenv]
deps =
- py==1.4.28
- pytest==2.7.1
+ py==1.4.30
+ pytest==2.8.3
commands =
py.test {posargs:test_pytest_catchlog.py}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pytest-catchlog.git
More information about the Python-modules-commits
mailing list