Add GitHub Actions testing workflow (#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
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
name: Tests
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
|
||||
name: Test on Python ${{ matrix.py_version }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
py_version: [2.7, 3.5, 3.6, 3.7]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up Python ${{ matrix.py_version }}
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: ${{ matrix.py_version }}
|
||||
- name: Install mock for Python 2.7
|
||||
run: pip install mock
|
||||
- name: Run tests
|
||||
run: python setup.py test
|
||||
+2
-2
@@ -2,9 +2,9 @@
|
||||
pydiscourse
|
||||
===========
|
||||
|
||||
.. image:: https://secure.travis-ci.org/bennylope/pydiscourse.svg?branch=master
|
||||
.. image:: https://github.com/bennylope/pydiscourse/workflows/Tests/badge.svg
|
||||
:alt: Build Status
|
||||
:target: http://travis-ci.org/bennylope/pydiscourse
|
||||
:target: https://github.com/bennylope/pydiscourse/actions
|
||||
|
||||
.. image:: https://img.shields.io/badge/Check%20out%20the-Docs-blue.svg
|
||||
:alt: Check out the Docs
|
||||
|
||||
@@ -34,15 +34,16 @@ setup(
|
||||
]
|
||||
},
|
||||
classifiers=[
|
||||
"Development Status :: 3 - Alpha",
|
||||
"Development Status :: 5 - Production/Stable"
|
||||
"Environment :: Web Environment",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Operating System :: OS Independent",
|
||||
"Programming Language :: Python",
|
||||
"Programming Language :: Python :: 2.7",
|
||||
"Programming Language :: Python :: 3.4",
|
||||
"Programming Language :: Python :: 3.5",
|
||||
"Programming Language :: Python :: 3.6",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
'Programming Language :: Python :: Implementation :: PyPy',
|
||||
],
|
||||
zip_safe=False,
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
import sys
|
||||
import unittest
|
||||
import mock
|
||||
|
||||
try:
|
||||
from unittest import mock
|
||||
except ImportError:
|
||||
import mock
|
||||
|
||||
from pydiscourse import client
|
||||
|
||||
import sys
|
||||
|
||||
if sys.version_info < (3,):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user