-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from mikemanger/update-tests
Fix tox and add GH workflow
- Loading branch information
Showing
8 changed files
with
59 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Configure Dependabot scanning. | ||
version: 2 | ||
|
||
updates: | ||
# Check for updates to GitHub Actions. | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
open-pull-requests-limit: 10 | ||
groups: | ||
github-actions: | ||
patterns: | ||
- "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Python package | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox tox-gh | ||
- name: Test with tox | ||
run: tox -e ${{ matrix.python-version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -206,7 +206,7 @@ def test_add_with_custom_fields(self): | |
self.subscriber.stub_request("subscribers/%s.json" % self.list_id, "add_subscriber.json") | ||
custom_fields = [ { "Key": 'website', "Value": 'http://example.com/' } ] | ||
email_address = self.subscriber.add(self.list_id, "[email protected]", "Subscriber", custom_fields, True) | ||
self.assertEquals(email_address, "[email protected]") | ||
self.assertEqual(email_address, "[email protected]") | ||
``` | ||
|
||
## Contributing | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,15 +42,15 @@ def test_delete(self): | |
email_address = self.administrator.delete() | ||
|
||
|
||
class OAuthAdministatorTestCase(unittest.TestCase, AdministratorTestCase): | ||
class OAuthAdministratorTestCase(unittest.TestCase, AdministratorTestCase): | ||
"""Test when using OAuth to authenticate""" | ||
|
||
def setUp(self): | ||
self.administrator = Administrator( | ||
{"access_token": "ASP95S4aR+9KsgfHB0dapTYxNA==", "refresh_token": "5S4aASP9R+9KsgfHB0dapTYxNA=="}, "[email protected]") | ||
|
||
|
||
class ApiKeyAdministatorTestCase(unittest.TestCase, AdministratorTestCase): | ||
class ApiKeyAdministratorTestCase(unittest.TestCase, AdministratorTestCase): | ||
"""Test when using an API key to authenticate""" | ||
|
||
def setUp(self): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
# Tox (http://tox.testrun.org/) is a tool for running tests | ||
# Tox (https://tox.wiki/) is a tool for running tests | ||
# in multiple virtualenvs. This configuration file will run the | ||
# test suite on all supported python versions. To use it, "pip install tox" | ||
# and then run "tox" from this directory. | ||
|
||
[tox] | ||
envlist = py36, py37, py38, py39, py310, py311, py312, py313 | ||
env_list = py38, py39, py310, py311, py312, py313 | ||
|
||
[testenv] | ||
install_command=pip install {packages} | ||
commands = | ||
coverage run --source=lib setup.py test | ||
coverage report | ||
pytest --cov=lib | ||
deps = | ||
coverage | ||
-e. | ||
pytest-cov | ||
# This needs to be set to include the test fixtures | ||
use_develop = true | ||
|
||
[gh] | ||
# Maps python versions for GitHub workflow | ||
python = | ||
3.8: py38 | ||
3.9: py39 | ||
3.10: py310 | ||
3.11: py311 | ||
3.12: py312 | ||
3.13: py313 |