Skip to content

Commit cddeb43

Browse files
committed
Finishing release 0.2
2 parents c0be301 + 3fa76fd commit cddeb43

18 files changed

+276
-33
lines changed

CHANGES.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
Changelog
22
============
33

4+
v0.2 (2015-10-20)
5+
---------------------
6+
7+
* Add support assertRegex/assertRegexpMatches, assertNotRegex
8+
assertRaisesRegex/assertRaisesRegexp assertWarnsRegex.
9+
10+
* `unittest2pytest` is now a `pytest` subproject.
11+
12+
* Minor fixes.
13+
14+
415
v0.1 (2015-10-16)
516
---------------------
617

README.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,24 @@ Helps converting unittest test-cases to pytest
77
-----------------------------------------------------
88

99
:Author: Hartmut Goebel <[email protected]>
10-
:Version: Version 0.1
10+
:Version: Version 0.2
1111
:Copyright: Hartmut Goebel
1212
:Licence: GNU Public Licence v3 or later (GPLv3+)
13-
:Homepage: https://github.com/htgoebel/unittest2pytest
13+
:Homepage: https://github.com/pytest-dev/unittest2pytest
1414

1515

16-
.. image:: https://secure.travis-ci.org/htgoebel/unittest2pytest.png?branch=master
17-
:target: https://travis-ci.org/htgoebel/unittest2pytest/
16+
.. image:: https://secure.travis-ci.org/pytest-dev/unittest2pytest.png?branch=master
17+
:target: https://travis-ci.org/pytest-dev/unittest2pytest/
1818

1919

2020
`unittest2pytest` is a tool that helps rewriting Python `unittest`
2121
test-cases into pytest_ test-cases.
2222

2323
In contrast to other similar tools, this `unittest2pytest`
24-
- handles keyword arguments,
25-
- handles single-line test-cases and several tests on one line,
26-
- uses context-handlers where appropriate.
24+
25+
* handles keyword arguments,
26+
* handles single-line test-cases and several tests on one line,
27+
* uses context-handlers where appropriate.
2728

2829
This is done by using ``lib2to3`` and Python's mighty ``inspect``
2930
module.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def read(filename):
4343
long_description=long_description,
4444
author="Hartmut Goebel",
4545
author_email="[email protected]",
46-
url="https://github.com/htgoebel/unittest2pytest",
46+
url="https://github.com/pytest-dev/unittest2pytest",
4747
packages=["unittest2pytest", "unittest2pytest.fixes"],
4848
entry_points={
4949
'console_scripts': [
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# required-method: assertNotRegex
2+
3+
class TestAssertEqual(TestCase):
4+
def test_you(self):
5+
self.assertNotRegex(abc, 'xxx')
6+
7+
def test_me(self):
8+
self.assertNotRegex(123, xxx+y)
9+
10+
def test_everybody(self):
11+
self.assertNotRegex( 'abc' , 'def' )
12+
13+
def test_message(self):
14+
self.assertNotRegex(123+z, xxx+y, msg='This is wrong!')
15+
self.assertNotRegex(123, xxx+y, 'This is wrong!')
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# required-method: assertNotRegex
2+
3+
class TestAssertEqual(TestCase):
4+
def test_you(self):
5+
assert not re.search('xxx', abc)
6+
7+
def test_me(self):
8+
assert not re.search(xxx+y, 123)
9+
10+
def test_everybody(self):
11+
assert not re.search('def', 'abc')
12+
13+
def test_message(self):
14+
assert not re.search(xxx+y, 123+z), 'This is wrong!'
15+
assert not re.search(xxx+y, 123), 'This is wrong!'
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# required-method: assertRaisesRegex
2+
3+
class TestRaises(TestCase):
4+
def test_simple(self):
5+
self.assertRaisesRegex(RunTimeError, pattern, someFunc)
6+
7+
def test_args(self):
8+
self.assertRaisesRegex(RunTimeError, pattern, someFunc, 1,2,3)
9+
10+
def test_kwargs(self):
11+
self.assertRaisesRegex(RunTimeError, pattern, someFunc, foo=42, bar=43)
12+
13+
def test_args_kwargs(self):
14+
self.assertRaisesRegex(RunTimeError, pattern, someFunc, 1,2,3, foo=42, bar=43)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# required-method: assertRaisesRegex
2+
3+
class TestRaises(TestCase):
4+
def test_simple(self):
5+
with pytest.raises(RunTimeError) as excinfo:
6+
someFunc()
7+
assert re.search(pattern, excinfo.value)
8+
9+
def test_args(self):
10+
with pytest.raises(RunTimeError) as excinfo:
11+
someFunc(1,2,3)
12+
assert re.search(pattern, excinfo.value)
13+
14+
def test_kwargs(self):
15+
with pytest.raises(RunTimeError) as excinfo:
16+
someFunc(foo=42, bar=43)
17+
assert re.search(pattern, excinfo.value)
18+
19+
def test_args_kwargs(self):
20+
with pytest.raises(RunTimeError) as excinfo:
21+
someFunc(1,2,3, foo=42, bar=43)
22+
assert re.search(pattern, excinfo.value)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# required-method: assertRaisesRegexp
2+
3+
class TestRaises(TestCase):
4+
def test_simple(self):
5+
self.assertRaisesRegexp(RunTimeError, pattern, someFunc)
6+
7+
def test_args(self):
8+
self.assertRaisesRegexp(RunTimeError, pattern, someFunc, 1,2,3)
9+
10+
def test_kwargs(self):
11+
self.assertRaisesRegexp(RunTimeError, pattern, someFunc, foo=42, bar=43)
12+
13+
def test_args_kwargs(self):
14+
self.assertRaisesRegexp(RunTimeError, pattern, someFunc, 1,2,3, foo=42, bar=43)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# required-method: assertRaisesRegexp
2+
3+
class TestRaises(TestCase):
4+
def test_simple(self):
5+
with pytest.raises(RunTimeError) as excinfo:
6+
someFunc()
7+
assert re.search(pattern, excinfo.value)
8+
9+
def test_args(self):
10+
with pytest.raises(RunTimeError) as excinfo:
11+
someFunc(1,2,3)
12+
assert re.search(pattern, excinfo.value)
13+
14+
def test_kwargs(self):
15+
with pytest.raises(RunTimeError) as excinfo:
16+
someFunc(foo=42, bar=43)
17+
assert re.search(pattern, excinfo.value)
18+
19+
def test_args_kwargs(self):
20+
with pytest.raises(RunTimeError) as excinfo:
21+
someFunc(1,2,3, foo=42, bar=43)
22+
assert re.search(pattern, excinfo.value)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# required-method: assertRegex
2+
3+
class TestAssertEqual(TestCase):
4+
def test_you(self):
5+
self.assertRegex(abc, 'xxx')
6+
7+
def test_me(self):
8+
self.assertRegex(123, xxx+y)
9+
10+
def test_everybody(self):
11+
self.assertRegex( 'abc' , 'def' )
12+
13+
def test_message(self):
14+
self.assertRegex(123+z, xxx+y, msg='This is wrong!')
15+
self.assertRegex(123, xxx+y, 'This is wrong!')

0 commit comments

Comments
 (0)