Skip to content

Commit 3c201e0

Browse files
committed
ci: enable eager import for pytest tests
Sets EAGER_IMPORT=1 in test scripts to catch import errors early as recommended by lazy-loader documentation
1 parent 107bb6d commit 3c201e0

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

template/.config/copier/mise/tasks/bench.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ function is-true() {
1616
esac
1717
}
1818

19+
# ref: <https://github.com/scientific-python/lazy-loader#early-failure>
20+
export EAGER_IMPORT=1
21+
1922
if is-true "${CI-}"; then
2023
pytest --codspeed "$@"
2124
else

template/.config/copier/mise/tasks/test.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ function is-true() {
1616
esac
1717
}
1818

19+
# ref: <https://github.com/scientific-python/lazy-loader#early-failure>
20+
export EAGER_IMPORT=1
21+
1922
if is-true "${CI-}"; then
2023
pytest --junit-xml="junit.xml" --cov --cov-branch --benchmark-disable --numprocesses="auto" "$@"
2124
else

0 commit comments

Comments
 (0)