Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI workflows to use pytest #37

Merged
merged 2 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,4 @@ jobs:
python -m autoeis install
- name: "Run tests"
run: |
# Test package is importable
python -c 'import autoeis as ae; print("From Python!")'
# Test Julia is accessible
python -c 'import autoeis as ae; Main = ae.julia_helpers.init_julia(); Main.println("From Julia!")'
# Test Julia backend is importable
python -c 'import autoeis as ae; ec = ae.julia_helpers.import_backend(); print(ec)'
pytest .
7 changes: 1 addition & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,4 @@ jobs:
python -m autoeis install
- name: "Run tests"
run: |
# Test package is importable
python -c 'import autoeis as ae; print("From Python!")'
# Test Julia is accessible
python -c 'import autoeis as ae; Main = ae.julia_helpers.init_julia(); Main.println("From Julia!")'
# Test Julia backend is importable
python -c 'import autoeis as ae; ec = ae.julia_helpers.import_backend(); print(ec)'
pytest .
6 changes: 4 additions & 2 deletions tests/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ def test_import_julia_modules():
Main = julia_helpers.init_julia()

# Ensure installed modules can be imported
julia_helpers.import_package(Main, "EquivalentCircuits")
ec = julia_helpers.import_package("EquivalentCircuits", Main=Main)
# Test Main is not required
ec = julia_helpers.import_package("EquivalentCircuits")

# Throw error for non-existent module
with pytest.raises(Exception):
julia_helpers.import_package(Main, "NonExistentModule")
julia_helpers.import_package("NonExistentModule", Main)
4 changes: 2 additions & 2 deletions tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def test_load_eis_data():
ae.load_eis_data("nonexistentfile.csv")

# Load a valid txt file of EIS data
fpath = ASSETS_DIR / 'testdata.txt'
df = ae.load_eis_data(fpath)
fpath = ASSETS_DIR / 'test_data.txt'
df = ae.io.load_eis_data(fpath)
frequencies = np.array(df["freq/Hz"]).astype(float)
reals = np.array(df["Re(Z)/Ohm"]).astype(float)
imags = -np.array(df["-Im(Z)/Ohm"]).astype(float)