Skip to content

Commit be74c4e

Browse files
authored
Add GitHub Actions testing workflow (pydiscourse#24)
* Add GitHub Actions testing workflow * Update named Python versions and dev status * Use unittest.mock as default mock source Fall back to package for Python 2.7 * Try installing mock outside of setup * Switch to GitHub actions shield
1 parent 9198a1d commit be74c4e

File tree

4 files changed

+33
-6
lines changed

4 files changed

+33
-6
lines changed

.github/workflows/test.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Tests
2+
3+
on: [push]
4+
5+
jobs:
6+
test:
7+
8+
name: Test on Python ${{ matrix.py_version }}
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
py_version: [2.7, 3.5, 3.6, 3.7]
13+
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Set up Python ${{ matrix.py_version }}
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: ${{ matrix.py_version }}
20+
- name: Install mock for Python 2.7
21+
run: pip install mock
22+
- name: Run tests
23+
run: python setup.py test

README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
pydiscourse
33
===========
44

5-
.. image:: https://secure.travis-ci.org/bennylope/pydiscourse.svg?branch=master
5+
.. image:: https://github.com/bennylope/pydiscourse/workflows/Tests/badge.svg
66
:alt: Build Status
7-
:target: http://travis-ci.org/bennylope/pydiscourse
7+
:target: https://github.com/bennylope/pydiscourse/actions
88

99
.. image:: https://img.shields.io/badge/Check%20out%20the-Docs-blue.svg
1010
:alt: Check out the Docs

setup.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,16 @@
3434
]
3535
},
3636
classifiers=[
37-
"Development Status :: 3 - Alpha",
37+
"Development Status :: 5 - Production/Stable"
3838
"Environment :: Web Environment",
3939
"Intended Audience :: Developers",
4040
"License :: OSI Approved :: MIT License",
4141
"Operating System :: OS Independent",
4242
"Programming Language :: Python",
4343
"Programming Language :: Python :: 2.7",
44-
"Programming Language :: Python :: 3.4",
4544
"Programming Language :: Python :: 3.5",
45+
"Programming Language :: Python :: 3.6",
46+
"Programming Language :: Python :: 3.7",
4647
'Programming Language :: Python :: Implementation :: PyPy',
4748
],
4849
zip_safe=False,

tests/test_client.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import sys
22
import unittest
3-
import mock
3+
4+
try:
5+
from unittest import mock
6+
except ImportError:
7+
import mock
48

59
from pydiscourse import client
610

7-
import sys
811

912
if sys.version_info < (3,):
1013

0 commit comments

Comments
 (0)