Skip to content

Commit 9c71c32

Browse files
authored
ci: make tests actually run (#7)
* ci: make tests actually run * test: update tests * chore: update license stuff
1 parent fc60093 commit 9c71c32

File tree

5 files changed

+24
-22
lines changed

5 files changed

+24
-22
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
python-version: ['3.8', '3.9', '3.10']
30-
platform: [ubuntu-latest, macos-latest, windows-latest]
29+
python-version: ['3.9', '3.10', '3.11']
30+
platform: [ubuntu-latest]
3131

3232
steps:
3333
- name: Cancel Previous Runs
@@ -45,12 +45,10 @@ jobs:
4545
- name: Install dependencies
4646
run: |
4747
python -m pip install -U pip
48-
python -m pip install tox tox-gh-actions
48+
python -m pip install -e .[test]
4949
50-
- name: Test with tox
51-
run: python -m tox
52-
env:
53-
PLATFORM: ${{ matrix.platform }}
50+
- name: Test
51+
run: pytest --color=yes --cov --cov-report=xml --cov-report=term-missing
5452

5553
- name: Coverage
5654
uses: codecov/codecov-action@v3

.github/workflows/cron.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
python-version: ['3.8', '3.9', '3.10']
20-
platform: [ubuntu-latest, macos-latest, windows-latest]
19+
python-version: ['3.9', '3.10', '3.11']
20+
platform: [ubuntu-latest]
2121

2222
steps:
2323
- uses: actions/checkout@v3
@@ -30,12 +30,10 @@ jobs:
3030
- name: Install dependencies
3131
run: |
3232
python -m pip install -U pip
33-
python -m pip install tox tox-gh-actions
33+
python -m pip install -e .[test]
3434
35-
- name: Test with tox
36-
run: python -m tox -v --pre
37-
env:
38-
PLATFORM: ${{ matrix.platform }}
35+
- name: Test
36+
run: pytest --color=yes --cov --cov-report=xml --cov-report=term-missing
3937

4038
# If something goes wrong, we can open an issue in the repo
4139
- name: Report Failures

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Kevin Dalton
3+
Copyright (c) 2023 Kevin Dalton, Ian Hunt-Isaak
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ authors = [
1616
]
1717
classifiers = [
1818
"Development Status :: 3 - Alpha",
19-
"License :: OSI Approved :: BSD License",
19+
"License :: OSI Approved :: MIT License",
2020
"Programming Language :: Python :: 3",
2121
"Programming Language :: Python :: 3.8",
2222
"Programming Language :: Python :: 3.9",

tests/test_mpl_arrow.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import numpy as np
22
from matplotlib import pyplot as plt
3-
from mpl_arrow import arrow
3+
from mpl_arrow import arrow, arrow_absolute, vector
44

55

6-
def test_smoke_test():
7-
for x, y in np.random.random((10, 2)):
8-
arrow(x, y)
9-
ax = plt.gca()
10-
assert len(ax.patches) == 10
6+
def test_basic_test():
7+
fig, ax = plt.subplots()
8+
arrow(1, 0, 2, 0.5, label="arrow")
9+
arrow_absolute(1, 0.5, 3.5, 2, label="arrow absolute")
10+
11+
vector(4, 4, label="vector")
12+
vector(4, 4, x=0, y=2, label="vector with offset")
13+
14+
assert len(ax.patches) == 4
15+
np.testing.assert_allclose(np.round(ax.get_xlim(), 3), (-0.203, 4.2))
16+
np.testing.assert_allclose(np.round(ax.get_ylim(), 3), (-0.306, 6.3))

0 commit comments

Comments
 (0)