Skip to content

Commit 15d9fbc

Browse files
committed
Merge branch 'release/1.5.1'
* release/1.5.1: bump 1.5.1 fixes test enviromnent updates readme updates readme typo in README
2 parents 69f3846 + 8525880 commit 15d9fbc

File tree

8 files changed

+37
-26
lines changed

8 files changed

+37
-26
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ language: python
22
sudo: false
33

44
python:
5-
- "2.6"
65
- "2.7"
76
- "3.3"
87
- "3.4"
@@ -12,7 +11,7 @@ python:
1211

1312
install:
1413
- pip install .
15-
- pip install tox coverage codecov
14+
- pip install tox codecov
1615
- "TOX_ENV=${TRAVIS_PYTHON_VERSION/[0-9].[0-9]/py${TRAVIS_PYTHON_VERSION/.}}"
1716

1817

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
1.5.1
2+
-----
3+
* drop suport python 2.6
4+
15
1.5
26
---
37
* add support for 'globbing' package version and enviromnent variables

README.rst

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
===========
12
pytest-echo
23
===========
34

5+
46
.. image:: https://badge.fury.io/py/pytest-echo.svg
57
:target: http://badge.fury.io/py/pytest-echo
68
:alt: PyPI package
@@ -13,8 +15,9 @@ Useful in the continuous integration to dump test
1315
configuration/environment and or to check is attributes are properly set
1416
(ie. you change environment with `os.environ`)
1517

18+
1619
Install
17-
-------
20+
=======
1821

1922
install via::
2023

@@ -26,30 +29,32 @@ The plugin provides ability to print some extra information prior to run the tes
2629

2730

2831

29-
Example
30-
-------
32+
Examples
33+
========
3134

3235
Dump environment variables
33-
~~~~~~~~~~~~~~~~~~~~~~~~~~
36+
--------------------------
3437

3538
.. code-block:: sh
3639
3740
$ py.test --echo-env=HOME
3841
============================= test session starts =========================
3942
platform linux2 -- Python 2.7.4 -- py-1.4.22 -- pytest-2.6.0 -- /bin/python
40-
HOME: /home/sax
43+
Environment:
44+
HOME: /Users/sax
4145
plugins: echo, pydev, cov, cache, django
4246
4347
4448
Dump package version
45-
~~~~~~~~~~~~~~~~~~~~
49+
--------------------
4650

4751
.. code-block:: sh
4852
4953
$ py.test --echo-version=pytest_echo
5054
============================= test session starts =========================
5155
platform linux2 -- Python 2.7.4 -- py-1.4.22 -- pytest-2.6.0 -- /bin/python
52-
pytest_echo: 0.1
56+
Package version:
57+
pytest_echo: 0.1
5358
plugins: echo, pydev, cov, cache, django
5459
5560
.. warning:: The first attempt to retrieve the version is done via setuptools
@@ -59,14 +64,15 @@ Dump package version
5964
should be present in the first level of the package
6065

6166
Dump attributes
62-
~~~~~~~~~~~~~~~
67+
---------------
6368

6469
.. code-block:: sh
6570
6671
$ py.test --echo-attr=django.conf.settings.DEBUG
6772
============================= test session starts =========================
6873
platform linux2 -- Python 2.7.4 -- py-1.4.22 -- pytest-2.6.0 -- /bin/python
69-
DEBUG: False
74+
Inspections
75+
django.conf.settings.DEBUG: False
7076
plugins: echo, pydev, cov, cache, django
7177
7278
.. warning:: Be careful when use ``--echo-attr``. It loads any module in the path and this will
@@ -77,7 +83,7 @@ Dump attributes
7783

7884

7985
Configure via tox.ini/setup.cfg/pytest.cfg
80-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
86+
------------------------------------------
8187

8288
Example of use in a django project:
8389

@@ -120,7 +126,7 @@ Example of use in a django project:
120126
121127
122128
Globbing
123-
~~~~~~~~
129+
--------
124130

125131
Starting from version 1.5, is possible to glob packages version and environment variables,
126132
as:
@@ -142,7 +148,7 @@ or
142148
143149
144150
Links
145-
~~~~~
151+
-----
146152

147153
+--------------------+----------------+--------------+-----------------+
148154
| Stable | |master-build| | |master-cov| | |master-doc| |

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6+
=======================================
67
Welcome to pytest-echo's documentation!
78
=======================================
89

pytest_echo.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# -*- coding: utf-8 -*-
2+
from __future__ import print_function
23
import fnmatch
34
import os
45
from pprint import pformat
56

67
import pip
78
from pkg_resources import DistributionNotFound
89

9-
__version__ = '1.5'
10+
__version__ = '1.5.1'
1011

1112

1213
def get_attr(obj, attr, default='NOT FOUND'):
@@ -63,11 +64,11 @@ def get_module_attribute(path):
6364
:param path: full path to the attribute
6465
:return:
6566
66-
>>> print get_module_attribute('linecache.cache.__class__')
67-
<type 'dict'>
68-
>>> print get_module_attribute('os.path.curdir')
67+
>>> print(get_module_attribute('linecache.cache.__class__'))
68+
<... 'dict'>
69+
>>> print(get_module_attribute('os.path.curdir'))
6970
'.'
70-
>>> print get_module_attribute('wrong')
71+
>>> print(get_module_attribute('wrong'))
7172
('Unable to load %s', 'wrong')
7273
"""
7374
parts = path.split('.')

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
23

34
from setuptools import setup
45
from pytest_echo import __version__
@@ -34,5 +35,5 @@
3435
'Programming Language :: Python :: 3.3',
3536
'Programming Language :: Python :: 3.4',
3637
'Programming Language :: Python :: 3.5',
37-
'Programming Language :: Python :: 3.6',
38+
'Programming Language :: Python :: 3.6'
3839
])

test_echo.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,8 @@ def test_echo_version_no_setuptools(testdir, monkeypatch):
8282

8383
def test_echo_version_glob(testdir):
8484
result = testdir.runpytest('--echo-version=pytest*')
85-
result.stdout.fnmatch_lines([" pytest: %s" % pytest.__version__,
86-
" pytest-echo: %s" % pytest_echo.__version__,
87-
])
85+
result.stdout.fnmatch_lines([" pytest: %s" % pytest.__version__])
86+
result.stdout.fnmatch_lines([" pytest-echo: %s" % pytest_echo.__version__])
8887

8988

9089
def test_echo_all(testdir):

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ envlist=py27,py33,py34,py35,py36,pypy
33

44
[testenv]
55
deps =
6-
py{27,33}: django<2
6+
py{27,33},pypy: django<2
77
py{34,35,36}: django
88
py{33,34}: pytest<3
99
py{33,34}: py<1.5
@@ -12,14 +12,14 @@ deps =
1212
commands =
1313
; py.test --pyargs test_echo.py
1414
pip install -e .
15-
coverage run -m py.test
15+
coverage run -m py.test test_echo.py pytest_echo.py
1616
coverage report
1717
coverage html
1818

1919
[pytest]
2020
pep8ignore = E128 E302
2121
doc/conf.py ALL
22-
;python_files=test_echo.py
22+
python_files=test_echo.py
2323

2424
addopts =
2525
--tb=short

0 commit comments

Comments
 (0)