Skip to content

Commit 01ec112

Browse files
committed
Merge branch 'release/1.4'
* release/1.4: fixes typo and docs fixes travis config fixes travis config updates tests configuration updated README bump 1.4 add .gitignore updates README add python 3.2 to classifier updates README removed assert of unicode string python 2.6 support update travis config add travis config
2 parents 1245405 + 8a5d7ce commit 01ec112

File tree

11 files changed

+66
-18
lines changed

11 files changed

+66
-18
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ dist
55
*.egg-info
66
*.pyc
77
__pycache__
8+
docs/_build

.travis.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
language: python
2+
3+
python:
4+
- "2.6"
5+
- "2.7"
6+
- "3.2"
7+
- "3.3"
8+
- "3.4"
9+
- "pypy"
10+
11+
install:
12+
- "pip install -e ."
13+
- "pip install pytest --use-mirrors"
14+
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then travis_retry pip install 'django<1.5'; fi
15+
- if [[ $TRAVIS_PYTHON_VERSION != '2.6' ]]; then travis_retry pip install 'django>=1.6'; fi
16+
17+
18+
branches:
19+
only:
20+
- develop
21+
22+
script:
23+
py.test

CHANGELOG

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
1.4
2+
---
3+
* fixes typo in documentation
4+
15
1.3
26
---
37
* fixes url in setup.py
48
* add ability to dump version using setuptools ``pkg_resources``
5-
* python 3.3/3.4
9+
* python 3.3/3.4
610

711
1.2
812
---

README.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ Dump package version
5353
pytest_echo: 0.1
5454
plugins: echo, pydev, cov, cache, django
5555
56+
.. warning:: The first attempt to retrieve the version is done via setuptools
57+
if it fails, the module is imported (``__import__(package)``) to retrieve the version reading
58+
``get_version``, ``__version__``, ``VERSION``, ``version`` so any module
59+
level code is executed. This should be not an issue as no problematic code
60+
should be present in the first level of the package
5661

5762
Dump attributes
5863
~~~~~~~~~~~~~~~
@@ -80,6 +85,7 @@ Example of use in a django project:
8085
.. code-block:: inifile
8186
8287
[pytest]
88+
addopts = -vvv
8389
--tb=short
8490
--capture=no
8591
--echo-env PWD
@@ -99,7 +105,7 @@ Example of use in a django project:
99105
platform linux2 -- Python 2.7.4 -- py-1.4.22 -- pytest-2.6.0 -- /bin/python
100106
Environment:
101107
DJANGO_SETTINGS_MODULE: tests.settings
102-
PWD: /data/PROGETTI/ONU_WorldFoodProgramme/wfp-auth
108+
PWD: /data/PROGETTI/sem
103109
VIRTUAL_ENV: /data/VENV/sem
104110
DBENGINE: <not set>
105111
Package version:
@@ -108,6 +114,10 @@ Example of use in a django project:
108114
pytest_echo: 1.2
109115
Inspections:
110116
django.conf.settings.DATABASES.default.ENGINE: 'django.db.backends.postgresql_psycopg2'
117+
plugins: echo, cache, capturelog, contextfixture, cov, django, pydev
118+
collected 14 items
119+
.............
120+
14 passed in 4.95 seconds
111121
112122
Links
113123
~~~~~

docs/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
Changelog
3+
=========
4+
5+
.. include:: ../CHANGELOG

docs/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6-
Welcome to pytest-cache's documentation!
6+
Welcome to pytest-echo's documentation!
77
========================================
88

99
Contents:
1010

1111
.. toctree::
12-
:maxdepth: 2
12+
:maxdepth: 1
1313

1414
readme
15-
15+
changelog

docs/readme.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
12
.. include:: ../README.rst

pytest_echo.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pprint import pformat
44

55

6-
__version__ = '1.3'
6+
__version__ = '1.4'
77

88

99
class RetrieveException(Exception):
@@ -72,17 +72,18 @@ def get_module_attribute(path):
7272
parent = ""
7373
pkg = None
7474
try:
75-
for i, el in enumerate(parts):
75+
for i, part in enumerate(parts):
7676
try:
7777
if parent:
78-
a = "{}.{}".format(parent, parts[i])
78+
module_name = "%s.%s" % (parent, parts[i])
7979
else:
80-
a = parts[i]
81-
pkg = __import__(a, fromlist=[parent])
82-
parent = a
80+
module_name = parts[i]
81+
pkg = __import__(module_name, fromlist=[parent])
82+
parent = module_name
8383
except ImportError:
84-
if hasattr(pkg, el):
84+
if hasattr(pkg, part):
8585
return pformat(get_attr(pkg, ".".join(parts[i:])))
86+
raise Exception('Unable to load %s', path)
8687
except Exception as e:
8788
return str(e)
8889

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
'Topic :: Software Development :: Libraries',
2929
'Topic :: Utilities',
3030
'Programming Language :: Python',
31+
'Programming Language :: Python :: 2.6',
3132
'Programming Language :: Python :: 2.7',
33+
'Programming Language :: Python :: 3.2',
3234
'Programming Language :: Python :: 3.3',
3335
'Programming Language :: Python :: 3.4',
3436
])

test_echo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,19 @@ def test_echo_attr_dict(testdir):
5959

6060
def test_echo_attr_list(testdir):
6161
result = testdir.runpytest('--echo-attr=test_echo.ATTR_LIST.2')
62-
result.stdout.fnmatch_lines([u" test_echo.ATTR_LIST.2: 13"])
62+
result.stdout.fnmatch_lines([" test_echo.ATTR_LIST.2: 13"])
6363

6464

6565
def test_echo_attr_list_inner(testdir):
6666
result = testdir.runpytest('--echo-attr=test_echo.ATTR_LIST.3.1')
67-
assert u" test_echo.ATTR_LIST.3.1: 22" in result.stdout.lines
67+
assert " test_echo.ATTR_LIST.3.1: 22" in result.stdout.lines
6868

6969

7070
def test_echo_attr_list_composite(testdir):
7171
result = testdir.runpytest('--echo-attr=test_echo.ATTR_COMPOSITE.key1',
7272
'--echo-attr=test_echo.ATTR_COMPOSITE.key2.3')
73-
assert u" test_echo.ATTR_COMPOSITE.key1: 'value1'" in result.stdout.lines
74-
assert u" test_echo.ATTR_COMPOSITE.key2.3: 14" in result.stdout.lines
73+
assert " test_echo.ATTR_COMPOSITE.key1: 'value1'" in result.stdout.lines
74+
assert " test_echo.ATTR_COMPOSITE.key2.3: 14" in result.stdout.lines
7575

7676

7777
def test_echo_attr_list_callable(testdir):

0 commit comments

Comments
 (0)