Skip to content

Commit

Permalink
[CI] Use pathlib features and update formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl committed Jan 14, 2022
1 parent 06a14a5 commit 18f40cd
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/python/runCythonTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@
import os
from pathlib import Path

cantera_root = os.path.relpath(__file__).split(os.sep)[:-1] + ['..', '..']
os.chdir(os.sep.join(cantera_root + ['test', 'work']))
CANTERA_ROOT = Path(__file__).parents[2]
os.chdir(str(CANTERA_ROOT / "test" / "work"))

import pytest
import cantera
import cantera.test


if __name__ == '__main__':
print('\n* INFO: using Cantera module found at this location:')
print('* ', repr(cantera.__file__))
print('* INFO: Cantera version:', cantera.__version__)
print('* INFO: Git commit:', cantera.__git_commit__, '\n')
if __name__ == "__main__":
print("\n* INFO: using Cantera module found at this location:")
print(f"* '{cantera.__file__}'")
print(f"* INFO: Cantera version: {cantera.__version__}")
print(f"* INFO: Git commit: {cantera.__git_commit__}\n")
sys.stdout.flush()

subset_start = 1
Expand All @@ -51,7 +51,7 @@
verbose = True
subset_start += 1

base = Path(cantera.__file__).parent.joinpath('test')
base = Path(cantera.__file__).parent.joinpath("test")
subsets = []
for name in sys.argv[subset_start:]:
subsets.append(str(base.joinpath(f"test_{name}.py")))
Expand Down

0 comments on commit 18f40cd

Please sign in to comment.