Skip to content

Commit 33b9dac

Browse files
Housekeeping for ultraplot-build.yml (#390)
* bump to 60 minutes * use mpl-hash * Add test message to module docstring * bump * only generate hashes * sanity checks * debug closing command * rm hashing * rm hashing * sanity checks * sanity checks * aggresively clean all * rm skip * final touches --------- Co-authored-by: Matthew R. Becker <[email protected]>
1 parent 7263c01 commit 33b9dac

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

.github/workflows/build-ultraplot.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515

1616
jobs:
1717
build-ultraplot:
18-
name: Test Python ${{ inputs.python-version }} with ${{ inputs.matplotlib-version }}
18+
name: Test Python ${{ inputs.python-version }} with MPL ${{ inputs.matplotlib-version }}
1919
runs-on: ubuntu-latest
2020
timeout-minutes: 60
2121
defaults:
@@ -52,6 +52,7 @@ jobs:
5252
slug: Ultraplot/ultraplot
5353

5454
compare-baseline:
55+
name: Compare baseline Python ${{ inputs.python-version }} with MPL ${{ inputs.matplotlib-version }}
5556
runs-on: ubuntu-latest
5657
defaults:
5758
run:
@@ -76,14 +77,23 @@ jobs:
7677
git fetch origin ${{ github.event.pull_request.base.sha }}
7778
git checkout ${{ github.event.pull_request.base.sha }}
7879
python -c "import ultraplot as plt; plt.config.Configurator()._save_yaml('ultraplot.yml')"
79-
pytest -W ignore --mpl-generate-path=baseline --mpl-default-style="./ultraplot.yml"
80+
pytest -W ignore \
81+
--mpl-generate-path=./baseline/ \
82+
--mpl-default-style="./ultraplot.yml"\
83+
ultraplot/tests
8084
git checkout ${{ github.sha }} # Return to PR branch
8185
8286
- name: Image Comparison Ultraplot
8387
run: |
8488
mkdir -p results
8589
python -c "import ultraplot as plt; plt.config.Configurator()._save_yaml('ultraplot.yml')"
86-
pytest -W ignore --mpl --mpl-baseline-path=baseline --mpl-generate-summary=html --mpl-results-path=./results/ --mpl-default-style="./ultraplot.yml" --store-failed-only ultraplot/tests
90+
pytest -W ignore \
91+
--mpl \
92+
--mpl-baseline-path=./baseline/ \
93+
--mpl-results-path=./results/ \
94+
--mpl-generate-summary=html \
95+
--mpl-default-style="./ultraplot.yml" \
96+
ultraplot/tests
8797
8898
# Return the html output of the comparison even if failed
8999
- name: Upload comparison failures

.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,3 @@ jobs:
153153
exit 1
154154
fi
155155
fi
156-

ultraplot/tests/conftest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os, shutil, pytest, re, numpy as np, ultraplot as uplt
22
from pathlib import Path
3-
import warnings, logging
3+
import warnings, logging, gc
4+
from matplotlib._pylab_helpers import Gcf
45

56
logging.getLogger("matplotlib").setLevel(logging.ERROR)
67
SEED = 51423
@@ -18,6 +19,9 @@ def rng():
1819
def close_figures_after_test():
1920
yield
2021
uplt.close("all")
22+
assert uplt.pyplot.get_fignums() == [], f"Open figures {uplt.pyplot.get_fignums()}"
23+
Gcf.destroy_all()
24+
gc.collect()
2125

2226

2327
# Define command line option

0 commit comments

Comments
 (0)