Skip to content

Commit 9f5c09b

Browse files
committed
Finished release 0.4.
2 parents 635a1f3 + 60150b3 commit 9f5c09b

File tree

74 files changed

+768
-113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+768
-113
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
/nosetests.xml
4545
/.cache
4646
/.coverage
47+
/.pytest_cache
4748
/.tox
4849
/.achievements
4950
/.installed.cfg

.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1+
dist: xenial
12
language: python
23
# Use new container-based Travis infrastructure.
34
sudo: false
5+
cache: pip
46

57
python:
68
- 2.7
7-
- 3.2
8-
- 3.3
99
- 3.4
1010
- 3.5
11+
- 3.6
12+
- 3.7
1113
- "nightly"
1214

1315
allow_failures:
14-
# Just tests how PyInstaller performs with upcoming Python 3.6
16+
# Just tests how PyInstaller performs with upcoming Python 3.8
1517
- python: "nightly"
1618

1719
# Install dependencies.

AUTHORS.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ Contributors
44
The number im front of each name denotes the number of commits by the
55
respective contributor.
66

7+
Contributors for v0.4
8+
------------------------
9+
10+
25 Hartmut Goebel <[email protected]>
11+
6 Jon Dufresne <[email protected]>
12+
2 Thomas Grainger <[email protected]>
13+
1 Aaron Godfrey <[email protected]>
14+
1 Joshua Howard <[email protected]>
15+
716

817
Contributors for v0.3
918
------------------------

CHANGES.rst

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
11
Changelog
22
============
33

4-
v0.3 (2016-07-26)
4+
0.4 (2019-06-30)
55
----------------
66

7+
* Add support for ``assertDictContainsSubset``.
8+
9+
* Put parenthesis around expressions if required.
10+
11+
* Fixed assertRaisesRegex, assertRaisesRegexp and assertWarnsRegex.
12+
The regex was getting replaced with an undefined variable `pattern`.
13+
14+
* Fix assertRaisesRegex and assertRaisesRegexp with `**kwargs` and
15+
`atom` parameters.
16+
17+
* Made assertRaisesRegex, assertRaisesRegexp and assertWarnsRegex use
18+
the `match` kwarg in `pytest.raises` instead of creating a variable
19+
with the context manager and doing an assert on `re.search`.
20+
21+
22+
* Add a short developer guide.
23+
24+
* Remove testing on Python 3.0, 3.1, 3.2, add 3.6 and 3.7.
25+
26+
* Distribute package as a universal wheel.
27+
28+
29+
v0.3 (2016-07-26)
30+
------------------
31+
732
* Add support for assertRaises / assertWarns context managers.
833

934
* Add support for converting lambda arguments in assertRaises into

DEVELOPER.rst

Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
2+
Testing
3+
===========
4+
5+
Continuous integration tests are available at
6+
https://travis-ci.org/pytest-dev/unittest2pytest/.
7+
8+
Prior to pushing a pull-request to github, please test locally::
9+
10+
pip install tox pytest
11+
tox # or tox -e py27,py33,py34
12+
13+
14+
Version Scheme
15+
=================
16+
17+
Regarding the version scheme, unittest2pytest conforms to :PEP:`440`.
18+
This basically means that releases will look like `0.3`, `0.3.1`,
19+
`0.4`, and pre-releases will have versions like `0.3.dev1`,
20+
`0.3.1.dev0`.
21+
22+
23+
How to Release
24+
=================
25+
26+
27+
Preparation
28+
-----------------
29+
30+
1. Get yourself an account at PyPI_ and TestPyPI_. Fill both
31+
credentials in your `~/.pypirc` file, as `described in the Python
32+
Wiki <https://wiki.python.org/moin/TestPyPI>`_.
33+
34+
* In difference to that description, list `pypitest` *first*. This
35+
will make `zest.releaser` push the release there first giving you
36+
a chance for last minute fixes.
37+
38+
2. Install `docutils` and `zest.releaser`, a helper for automating
39+
releasing a Python project::
40+
41+
pip install --user docutils zest.releaser
42+
43+
44+
Full Release Process
45+
---------------------
46+
47+
1. Prepare (see above).
48+
49+
2. Implement and close all issues and pull requests in a specific
50+
milestone.
51+
52+
3. Ensure everything relevant is committed and tested. ``git stash``
53+
your local changes which should not go into the release.
54+
55+
4. Be sure that the current code passes tests locally::
56+
57+
tox -e py27,py33,py34
58+
59+
5. Be sure `CI tests
60+
<https://travis-ci.org/pytest-dev/unittest2pytest/>`_ pass.
61+
62+
63+
Now we start with the main release process.
64+
65+
6. Set shell variables to be able to copy-and-paste the remaining
66+
snippets, e.g.::
67+
68+
version=0.3
69+
prev_version=0.2
70+
71+
7. Create the **release branch**::
72+
73+
git checkout -b release/$version
74+
75+
8. **Update versions** in source-code, Changelog, etc.::
76+
77+
prerelease # zest.releaser command
78+
79+
This will
80+
81+
- ask you a few questions - required version, etc.
82+
- remove `.devN` from the version string
83+
- update date and version in `CHANGES.rst`
84+
85+
9. Update **``CHANGES.rst``** and **``AUTHORS``**.
86+
87+
Where to look for possible changes? You can look in pull requests,
88+
issues, commits, mailing list or even the tool's cli options
89+
(new/removed options).
90+
91+
Authors should be updated based on merged pull requests::
92+
93+
git shortlog --numbered --summary --email v${prev_version}..HEAD
94+
95+
a. Check if the files are valid reStructuredText by running::
96+
97+
rst2html CHANGES.rst > /tmp/CHANGES.html
98+
xdg-open /tmp/CHANGES.html # opens file in your web-browser
99+
100+
b. If everything is fine, commit::
101+
102+
git commit -m "Update CHANGES and AUTHORS for release $version" \
103+
CHANGES.rst AUTHORS.txt
104+
105+
106+
10. In the **README**, update the versions in the badge-images and
107+
related links.
108+
109+
a. Verify the result be running::
110+
111+
git diff --color-words='.' README.rst
112+
113+
b. Again, check if the files are valid reStructuredText by running::
114+
115+
rst2html README.rst > /tmp/README.html
116+
xdg-open /tmp/README.html # opens file in your web-browser
117+
118+
c. If everything is fine, commit::
119+
120+
git commit -m 'Update versions in README.' README.rst
121+
README_CHANGE=$(git rev-parse --short HEAD) # remember this commit
122+
123+
11. Adjust whatever else is required for the release *now*.
124+
125+
126+
12. Complete the release:
127+
128+
a. Merge into branch `master`::
129+
130+
git checkout master
131+
git merge --no-ff -X theirs -m "Finished release $version." \
132+
release/$version
133+
134+
b. In case of a merge-conflict, resolve it using::
135+
136+
git gui # In the context-menu select "Use Local Version"
137+
git commit -m "Release $version."
138+
139+
140+
13. Run the release script ``release`` and it will do:
141+
142+
- create a signed tag for the released version
143+
- create and sign source archives
144+
- uploads them to PyPI
145+
146+
::
147+
148+
release # zest.releaser command
149+
150+
Submit to `testpypi` first! You can not change any file after
151+
you've uploaded it to PyPI!
152+
153+
14. Push the changes::
154+
155+
git push --follow-tags origin master
156+
157+
15. Create release on github:
158+
159+
a. Go to the `unittest2pytest release page
160+
<https://github.com/pytest-dev/unittest2pytest/releases>`_
161+
162+
b. Edit the latest `tag` details.
163+
164+
c. Copy there changelog for the current release. This should look
165+
like `this one
166+
<https://github.com/pytest-dev/unittest2pytest/releases/tag/v0.3>`_
167+
168+
d. Upload the `.tar.gz`- and `.zip`-archives and GPG-signatures
169+
that where uploaded to |unittest2pytest@PyPI|_
170+
171+
Note: If you are using stuff like RequestBlocker or NoScript in
172+
your web-browser, mind to allow some additional access.
173+
174+
175+
Now we are going to perform some **post-release** steps:
176+
177+
16. Forward the release-branch to master and check it out::
178+
179+
git checkout master
180+
git branch -f release/$version master
181+
git checkout release/$version
182+
183+
17. Revert the version-related to the README (using the commit we
184+
remembered earlier)::
185+
186+
git revert $README_CHANGE
187+
188+
18. Run the release script ``postrelease``::
189+
190+
postrelease # zest.releaser command
191+
192+
This will
193+
194+
- increment version string for a new release: `3.0 -> 3.1.dev0`
195+
- prepare `CHANGES.rst` for the next release.
196+
197+
You need to manually check the `README` and the version in
198+
`CHANGES`.
199+
200+
19. Merge into branch `develop`::
201+
202+
git checkout develop
203+
git merge --no-ff -m "Finished release $version." release/$version
204+
205+
20. Check the diffs: it should only be version related stuff::
206+
207+
git diff origin/develop
208+
209+
21. Push the changes and delete the local release branch::
210+
211+
git push --follow-tags origin develop master
212+
git branch -d release/$version
213+
214+
215+
.. _PyPI: https://pypi.python.org/
216+
.. _TestPyPI: https://testpypi.python.org/pypi
217+
.. |unittest2pytest@PyPI| replace:: unittest2pytest at PyPI
218+
.. _unittest2pytest@PyPI: https://pypi.python.org/unittest2pytest
219+
220+
..
221+
Local Variables:
222+
mode: rst
223+
ispell-local-dictionary: "american"
224+
coding: utf-8
225+
End:

README.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ Helps converting unittest test-cases to pytest
77
-----------------------------------------------------
88

99
:Author: Hartmut Goebel <[email protected]>
10-
:Version: Version 0.3
11-
:Copyright: Hartmut Goebel
10+
:Version: 0.4
11+
:Copyright: 2015-2019 by Hartmut Goebel
1212
:Licence: GNU Public Licence v3 or later (GPLv3+)
1313
:Homepage: https://github.com/pytest-dev/unittest2pytest
1414

1515

16-
.. image:: https://img.shields.io/travis/pytest-dev/unittest2pytest/v0.3.svg
16+
.. image:: https://secure.travis-ci.org/pytest-dev/unittest2pytest.png?branch=develop
1717
:target: https://travis-ci.org/pytest-dev/unittest2pytest/
18-
:alt: Travis CI test status
1918

2019

2120
`unittest2pytest` is a tool that helps rewriting Python `unittest`

setup.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1+
[bdist_wheel]
2+
universal = 1
3+
14
[zest.releaser]
25
python-file-with-version = unittest2pytest/__init__.py
6+
push-changes = no
7+
tag-format = v{version}
8+
tag-message = unittest2pytest {version}
9+
tag-signing = yes

setup.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
#
4-
# Copyright 2015 by Hartmut Goebel <[email protected]>
4+
# Copyright 2015-2019 by Hartmut Goebel <[email protected]>
55
#
66
# This file is part of unittest2pytest.
77
#
@@ -69,6 +69,16 @@ def read(filename):
6969
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
7070
"Operating System :: OS Independent",
7171
"Programming Language :: Python",
72+
"Programming Language :: Python :: 2",
73+
"Programming Language :: Python :: 2.7",
74+
"Programming Language :: Python :: 3",
75+
"Programming Language :: Python :: 3.4",
76+
"Programming Language :: Python :: 3.5",
77+
"Programming Language :: Python :: 3.6",
78+
"Programming Language :: Python :: 3.7",
7279
"Topic :: Software Development",
7380
"Topic :: Utilities",
74-
])
81+
],
82+
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
83+
zip_safe=False
84+
)

tests/fixtures/self_assert/assertAlmostEqual_in.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
class TestAlmostAssertEqual(TestCase):
44
def test_simple(self):
55
self.assertAlmostEqual(100, klm)
6+
self.assertAlmostEqual(456, aaa and bbb)
7+
self.assertAlmostEqual(789, ccc or ddd)
8+
self.assertAlmostEqual(123, True if You else False)
69

710
def test_simple_msg(self):
811
self.assertAlmostEqual(klm, 100, msg="This is wrong!")

tests/fixtures/self_assert/assertAlmostEqual_out.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
class TestAlmostAssertEqual(TestCase):
44
def test_simple(self):
55
assert round(abs(100-klm), 7) == 0
6+
assert round(abs(456-(aaa and bbb)), 7) == 0
7+
assert round(abs(789-(ccc or ddd)), 7) == 0
8+
assert round(abs(123-(True if You else False)), 7) == 0
69

710
def test_simple_msg(self):
811
assert round(abs(klm-100), 7) == 0, "This is wrong!"

0 commit comments

Comments
 (0)