Skip to content

Commit f74dfff

Browse files
authored
Merge pull request #83 from mikemanger/update-tests
Fix tox and add GH workflow
2 parents 2d2fc3d + 049a063 commit f74dfff

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+
# Check for updates to GitHub Actions.
6+
- package-ecosystem: "github-actions"
7+
directory: "/"
8+
schedule:
9+
interval: "weekly"
10+
open-pull-requests-limit: 10
11+
groups:
12+
github-actions:
13+
patterns:
14+
- "*"

.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+
- push
5+
- pull_request
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install tox tox-gh
24+
- name: Test with tox
25+
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
self.subscriber.stub_request("subscribers/%s.json" % self.list_id, "add_subscriber.json")
207207
custom_fields = [ { "Key": 'website', "Value": 'http://example.com/' } ]
208208
email_address = self.subscriber.add(self.list_id, "[email protected]", "Subscriber", custom_fields, True)
209-
self.assertEquals(email_address, "[email protected]")
209+
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
"Programming Language :: Python :: 3",
3535

3636
# Specifically, we support the following releases.
37-
"Programming Language :: Python :: 3.6",
38-
"Programming Language :: Python :: 3.7",
3937
"Programming Language :: Python :: 3.8",
4038
"Programming Language :: Python :: 3.9",
4139
"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 @@ def test_delete(self):
4242
email_address = self.administrator.delete()
4343

4444

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

4848
def setUp(self):
4949
self.administrator = Administrator(
5050
{"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
"""Test when using an API key to authenticate"""
5555

5656
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-
coverage run --source=lib setup.py test
13-
coverage report
11+
pytest --cov=lib
1412
deps =
15-
coverage
16-
-e.
13+
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+
3.8: py38
21+
3.9: py39
22+
3.10: py310
23+
3.11: py311
24+
3.12: py312
25+
3.13: py313

0 commit comments

Comments
 (0)