Skip to content

Commit 8c9f32b

Browse files
authored
Merge pull request #57 from hugovk/replace-travis-with-gha
2 parents 39cdfaa + 622abb4 commit 8c9f32b

File tree

13 files changed

+89
-138
lines changed

13 files changed

+89
-138
lines changed

.github/workflows/test.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Test
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
env:
6+
FORCE_COLOR: 1
7+
8+
jobs:
9+
test:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10-dev"]
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
exclude:
17+
# TODO Fix these versions on Windows
18+
- {os: windows-latest, python-version: "3.7"}
19+
- {os: windows-latest, python-version: "3.8"}
20+
- {os: windows-latest, python-version: "3.9"}
21+
- {os: windows-latest, python-version: "3.10-dev"}
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v2
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Get pip cache dir
32+
id: pip-cache
33+
run: |
34+
echo "::set-output name=dir::$(pip cache dir)"
35+
36+
- name: Cache
37+
uses: actions/cache@v2
38+
with:
39+
path: ${{ steps.pip-cache.outputs.dir }}
40+
key:
41+
${{ matrix.os }}-${{ matrix.python-version }}-v1-${{ hashFiles('**/tox.ini') }}
42+
restore-keys: |
43+
${{ matrix.os }}-${{ matrix.python-version }}-v1-
44+
45+
- name: Install dependencies
46+
run: |
47+
python -m pip install -U pip
48+
python -m pip install -e .
49+
pip install -r tests/requirements.txt
50+
51+
- name: Test
52+
run: |
53+
pytest -vv

.travis.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

DEVELOPER.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ Testing
33
===========
44

55
Continuous integration tests are available at
6-
https://travis-ci.org/pytest-dev/unittest2pytest/.
6+
https://github.com/pytest-dev/unittest2pytest/actions.
77

8-
Prior to pushing a pull-request to github, please test locally::
8+
Prior to pushing a pull request to GitHub, please test locally::
99

1010
pip install tox pytest
11-
tox # or tox -e py27,py33,py34
11+
tox # or tox -e py37,py38,py39
1212

1313

1414
Version Scheme
@@ -54,10 +54,10 @@ Full Release Process
5454

5555
4. Be sure that the current code passes tests locally::
5656

57-
tox -e py27,py33,py34
57+
tox -e py37,py38,py39
5858

5959
5. Be sure `CI tests
60-
<https://travis-ci.org/pytest-dev/unittest2pytest/>`_ pass.
60+
<https://github.com/pytest-dev/unittest2pytest/actions>`_ pass.
6161

6262

6363
Now we start with the main release process.
@@ -154,7 +154,7 @@ Now we start with the main release process.
154154

155155
git push --follow-tags origin master
156156

157-
15. Create release on github:
157+
15. Create release on GitHub:
158158

159159
a. Go to the `unittest2pytest release page
160160
<https://github.com/pytest-dev/unittest2pytest/releases>`_

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Helps converting unittest test-cases to pytest
1313
:Homepage: https://github.com/pytest-dev/unittest2pytest
1414

1515

16-
.. image:: https://secure.travis-ci.org/pytest-dev/unittest2pytest.png?branch=develop
17-
:target: https://travis-ci.org/pytest-dev/unittest2pytest/
18-
16+
.. image:: https://github.com/pytest-dev/unittest2pytest/actions/workflows/test.yml/badge.svg
17+
:target: https://github.com/pytest-dev/unittest2pytest/actions
18+
:alt: See Build Status on GitHub Actions
1919

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

setup.cfg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[bdist_wheel]
2-
universal = 1
3-
41
[zest.releaser]
52
python-file-with-version = unittest2pytest/__init__.py
63
push-changes = no

setup.py

Lines changed: 8 additions & 13 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
#
@@ -20,9 +19,7 @@
2019
#
2120

2221
from setuptools import setup
23-
import codecs
2422
import re
25-
import sys
2623

2724

2825
def get_version(filename):
@@ -37,14 +34,11 @@ def get_version(filename):
3734

3835

3936
def read(filename):
40-
try:
41-
return unicode(codecs.open(filename, encoding='utf-8').read())
42-
except NameError:
43-
return open(filename, 'r', encoding='utf-8').read()
37+
return open(filename, encoding='utf-8').read()
38+
39+
4440
long_description = '\n\n'.join([read('README.rst'),
4541
read('CHANGES.rst')])
46-
if sys.version_info < (3,):
47-
long_description = long_description.encode('utf-8')
4842

4943

5044
setup(
@@ -69,15 +63,16 @@ def read(filename):
6963
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
7064
"Operating System :: OS Independent",
7165
"Programming Language :: Python",
72-
"Programming Language :: Python :: 2",
73-
"Programming Language :: Python :: 2.7",
7466
"Programming Language :: Python :: 3",
75-
"Programming Language :: Python :: 3.5",
67+
"Programming Language :: Python :: 3 :: Only",
7668
"Programming Language :: Python :: 3.6",
7769
"Programming Language :: Python :: 3.7",
70+
"Programming Language :: Python :: 3.8",
71+
"Programming Language :: Python :: 3.9",
72+
"Programming Language :: Python :: 3.10",
7873
"Topic :: Software Development",
7974
"Topic :: Utilities",
8075
],
81-
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
76+
python_requires=">=3.6",
8277
zip_safe=False
8378
)

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:

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Tox (http://tox.testrun.org/) is a tool for running tests
1+
# Tox (https://tox.readthedocs.io) is a tool for running tests
22
# in multiple virtualenvs. This configuration file will run the
33
# test suite on all supported python versions. To use it, "pip install tox"
44
# and then run "tox" from this directory.
55

66
[tox]
7-
envlist = py27, py35, py36, py37
7+
envlist = py36, py37, py38, py39, py310
88

99
[testenv]
1010
deps =

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
#

0 commit comments

Comments
 (0)