Skip to content

Commit be3e1b3

Browse files
authored
Merge pull request #83 from mikemanger/update-tests
Fix tox and add GH workflow
2 parents aa2f0d4 + 394a101 commit be3e1b3

File tree

8 files changed

+59
-16
lines changed

8 files changed

+59
-16
lines changed

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Configure Dependabot scanning.
2+
version: 2
3+
4+
updates:
5+
***REMOVED***# Check for updates to GitHub Actions.
6+
***REMOVED***- package-ecosystem: "github-actions"
7+
***REMOVED******REMOVED***directory: "/"
8+
***REMOVED******REMOVED***schedule:
9+
***REMOVED******REMOVED******REMOVED***interval: "weekly"
10+
***REMOVED******REMOVED***open-pull-requests-limit: 10
11+
***REMOVED******REMOVED***groups:
12+
***REMOVED******REMOVED******REMOVED***github-actions:
13+
***REMOVED******REMOVED******REMOVED******REMOVED***patterns:
14+
***REMOVED******REMOVED******REMOVED******REMOVED******REMOVED***- "*"

.github/workflows/tests.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Python package
2+
3+
on:
4+
***REMOVED***- push
5+
***REMOVED***- pull_request
6+
7+
jobs:
8+
***REMOVED***test:
9+
***REMOVED******REMOVED***runs-on: ubuntu-latest
10+
***REMOVED******REMOVED***strategy:
11+
***REMOVED******REMOVED******REMOVED***matrix:
12+
***REMOVED******REMOVED******REMOVED******REMOVED***python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
13+
14+
***REMOVED******REMOVED***steps:
15+
***REMOVED******REMOVED***- uses: actions/checkout@v4
16+
***REMOVED******REMOVED***- name: Set up Python ${{ matrix.python-version }}
17+
***REMOVED******REMOVED******REMOVED***uses: actions/setup-python@v5
18+
***REMOVED******REMOVED******REMOVED***with:
19+
***REMOVED******REMOVED******REMOVED******REMOVED***python-version: ${{ matrix.python-version }}
20+
***REMOVED******REMOVED***- name: Install dependencies
21+
***REMOVED******REMOVED******REMOVED***run: |
22+
***REMOVED******REMOVED******REMOVED******REMOVED***python -m pip install --upgrade pip
23+
***REMOVED******REMOVED******REMOVED******REMOVED***pip install tox tox-gh
24+
***REMOVED******REMOVED***- name: Test with tox
25+
***REMOVED******REMOVED******REMOVED***run: tox -e ${{ matrix.python-version }}

HISTORY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
## v5.0.0 - 10 Apr, 2018
4949

50-
* Drop offical support for Python 2.6
50+
* Drop official support for Python 2.6
5151
* Add a client-side timeout setting to `CreateSend`
5252
* No breaking changes for Python2.7 or Python3.x
5353

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def test_add_with_custom_fields(self):
206206
***REMOVED***self.subscriber.stub_request("subscribers/%s.json" % self.list_id, "add_subscriber.json")
207207
***REMOVED***custom_fields = [ { "Key": 'website', "Value": 'http://example.com/' } ]
208208
***REMOVED***email_address = self.subscriber.add(self.list_id, "[email protected]", "Subscriber", custom_fields, True)
209-
***REMOVED***self.assertEquals(email_address, "[email protected]")
209+
***REMOVED***self.assertEqual(email_address, "[email protected]")
210210
```
211211

212212
## Contributing

nosetests.py

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

setup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
***REMOVED******REMOVED******REMOVED******REMOVED***"Programming Language :: Python :: 3",
3535

3636
***REMOVED******REMOVED******REMOVED******REMOVED***# Specifically, we support the following releases.
37-
***REMOVED******REMOVED******REMOVED******REMOVED***"Programming Language :: Python :: 3.6",
38-
***REMOVED******REMOVED******REMOVED******REMOVED***"Programming Language :: Python :: 3.7",
3937
***REMOVED******REMOVED******REMOVED******REMOVED***"Programming Language :: Python :: 3.8",
4038
***REMOVED******REMOVED******REMOVED******REMOVED***"Programming Language :: Python :: 3.9",
4139
***REMOVED******REMOVED******REMOVED******REMOVED***"Programming Language :: Python :: 3.10",

test/test_administrator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ class AdministratorTestCase:
4242
***REMOVED******REMOVED******REMOVED******REMOVED***email_address = self.administrator.delete()
4343

4444

45-
class OAuthAdministatorTestCase(unittest.TestCase, AdministratorTestCase):
45+
class OAuthAdministratorTestCase(unittest.TestCase, AdministratorTestCase):
4646
***REMOVED******REMOVED***"""Test when using OAuth to authenticate"""
4747

4848
***REMOVED******REMOVED***def setUp(self):
4949
***REMOVED******REMOVED******REMOVED******REMOVED***self.administrator = Administrator(
5050
***REMOVED******REMOVED******REMOVED******REMOVED******REMOVED******REMOVED***{"access_token": "ASP95S4aR+9KsgfHB0dapTYxNA==", "refresh_token": "5S4aASP9R+9KsgfHB0dapTYxNA=="}, "[email protected]")
5151

5252

53-
class ApiKeyAdministatorTestCase(unittest.TestCase, AdministratorTestCase):
53+
class ApiKeyAdministratorTestCase(unittest.TestCase, AdministratorTestCase):
5454
***REMOVED******REMOVED***"""Test when using an API key to authenticate"""
5555

5656
***REMOVED******REMOVED***def setUp(self):

tox.ini

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
1-
# Tox (http://tox.testrun.org/) is a tool for running tests
1+
# Tox (https://tox.wiki/) 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 = py36, py37, py38, py39, py310, py311, py312, py313
7+
env_list = py38, py39, py310, py311, py312, py313
88

99
[testenv]
10-
install_command=pip install {packages}
1110
commands =
12-
***REMOVED******REMOVED***coverage run --source=lib setup.py test
13-
***REMOVED******REMOVED***coverage report
11+
***REMOVED******REMOVED***pytest --cov=lib
1412
deps =
15-
***REMOVED******REMOVED***coverage
16-
***REMOVED******REMOVED***-e.
13+
***REMOVED******REMOVED***pytest-cov
14+
# This needs to be set to include the test fixtures
15+
use_develop = true
16+
17+
[gh]
18+
# Maps python versions for GitHub workflow
19+
python =
20+
***REMOVED******REMOVED***3.8: py38
21+
***REMOVED******REMOVED***3.9: py39
22+
***REMOVED******REMOVED***3.10: py310
23+
***REMOVED******REMOVED***3.11: py311
24+
***REMOVED******REMOVED***3.12: py312
25+
***REMOVED******REMOVED***3.13: py313

0 commit comments

Comments
 (0)