Skip to content

Commit 622abb4

Browse files
committed
Upgrade Python syntax with pyupgrade --py36-plus (don't apply assert changes)
1 parent 498d6e1 commit 622abb4

File tree

7 files changed

+2
-10
lines changed

7 files changed

+2
-10
lines changed

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env python
2-
# -*- coding: utf-8 -*-
32
#
43
# Copyright 2015-2019 by Hartmut Goebel <h.goebel@crazy-compilers.com>
54
#
@@ -35,7 +34,7 @@ def get_version(filename):
3534

3635

3736
def read(filename):
38-
return open(filename, 'r', encoding='utf-8').read()
37+
return open(filename, encoding='utf-8').read()
3938

4039

4140
long_description = '\n\n'.join([read('README.rst'),

tests/test_all_fixes.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env python
2-
# -*- coding: utf-8 -*-
32
"""
43
This file is part of test-suite for unittest2pytest.
54
"""
@@ -22,7 +21,6 @@
2221
# along with this program. If not, see <http://www.gnu.org/licenses/>.
2322
#
2423

25-
from __future__ import unicode_literals
2624

2725
__author__ = "Hartmut Goebel <h.goebel@crazy-compilers.com>"
2826
__copyright__ = "Copyright 2015-2019 by Hartmut Goebel"
@@ -108,7 +106,7 @@ def test_check_fixture(in_file, fixer, tmpdir):
108106
try:
109107
compile(''.join(expected_contents), expected_file, 'exec')
110108
except Exception as e:
111-
pytest.fail("FATAL: %s does not compile: %s" % (expected_file, e),
109+
pytest.fail(f"FATAL: {expected_file} does not compile: {e}",
112110
False)
113111

114112
if result_file_contents != expected_contents:

unittest2pytest/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
# Copyright 2015-2019 by Hartmut Goebel <h.goebel@crazy-compilers.com>
43
#

unittest2pytest/__main__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
# Copyright 2015-2019 by Hartmut Goebel <h.goebel@crazy-compilers.com>
43
#

unittest2pytest/fixes/fix_remove_class.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
fix_remove_class - lib2to3 fix for removing "class Testxxx(TestCase):"
43
headers and dedenting the contained code.

unittest2pytest/fixes/fix_self_assert.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
fix_self_assert - lib2to3 fix for replacing assertXXX() method calls
43
by their pytest equivalent.

unittest2pytest/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
Some utility functions for unittest2pytest.
43
"""

0 commit comments

Comments
 (0)