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

change from unittest to pytest #348

Merged
merged 100 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
5e8beb3
Added directories and conf_pytest.py-file
OberGue Feb 2, 2024
e920b41
Added test_arrays.py-file and changed it to pytest
OberGue Feb 2, 2024
a52bd9a
Added test_bezier_extraction.py-file and changed it to pytest
OberGue Feb 2, 2024
b90db6a
Changed filename to conftest.py
OberGue Feb 2, 2024
10096b0
Defined fixtures in conftest and adjusted testfiles to pytest
OberGue Feb 8, 2024
45b9adc
Added bezier_operations-File; simplified bezier_extractions-File and …
OberGue Feb 8, 2024
2f7145a
Fix: Generator initialization, Add: warning supression for jupyter_cl…
clemens-fricke Feb 8, 2024
2d0cffb
Fix: using np_rng-fixture consistently now
OberGue Feb 28, 2024
da0ca25
Add: test_c_contiguous-file and changed it to pytest
OberGue Feb 28, 2024
58053f3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 28, 2024
10031d5
Add: test_cartesian-file and changed it to pytest
OberGue Feb 28, 2024
f20d936
Add: test_cats-file and changed it to pytest; Fix: conftest according…
OberGue Mar 1, 2024
ddac02f
Add: test_creator-file and changed it to pytest, note: WIP
OberGue Mar 1, 2024
683b68e
Fix: finished test_creator-file
OberGue Mar 4, 2024
66add7c
Fix: every np_rng-fixture-call now without request
OberGue Mar 4, 2024
83f3199
Add: test_evaluation-file and changed it to pytest; Note: error and WIP
OberGue Mar 4, 2024
fbca39e
Fix: test_evaluation-file error solved; test_creator-file comment rem…
OberGue Mar 5, 2024
491ba52
Fix: test_evaluation-file - added new testfunction and setup function
OberGue Mar 5, 2024
fd7d9d8
Add: testfunctions in test_evaluation-file
OberGue Mar 6, 2024
9ec53a5
Fix: test_evaluation-file - getting rid of getfixturevalue where unne…
OberGue Mar 6, 2024
4f3ff14
Ft: example for parameterization
clemens-fricke Mar 6, 2024
4053971
Add: test_extract-file and changed it to pytest
OberGue Mar 14, 2024
b56b6a9
Add: test_fitting-file and changed it to pytest
OberGue Mar 25, 2024
4fdf3fe
Add: test_gismo-file and changed it to pytest; Note: error - super() …
OberGue Mar 25, 2024
48943a0
Add: test_greville-file and changed it to pytest
OberGue Mar 26, 2024
755f6f2
Add: test_iges-file and changed it to pytest
OberGue Mar 26, 2024
33121c3
Add: test_irit_io-file and changed it to pytest
OberGue Mar 26, 2024
7c3f109
Add: test_json-file and changed it to pytest
OberGue Mar 26, 2024
e18d0c3
Add: test_knot_vectors-file and changed it to pytest
OberGue Mar 26, 2024
af1f3b4
Add: test_kv_manipulation-file and changed it to pytest; Note: misdim…
OberGue Mar 26, 2024
e1ed1b2
Add: test_mapping-file and changed it to pytest; Note: WIP and issues…
OberGue Mar 26, 2024
7214cf0
Add: test_mapping-file finished; Note: Issues probably resolved
OberGue Apr 2, 2024
bd19064
Add: test_mfem_export-file and changed it to pytest; Note: error - su…
OberGue Apr 2, 2024
f04bcaf
Add: test_multi_index-file and changed it to pytest
OberGue Apr 2, 2024
b77d9a2
Add: test_multipatch-file and changed it to pytest; Note: 3 errors du…
OberGue Apr 2, 2024
3d485c9
Add: test_normalize_knot_vectors-file and changed it to pytest
OberGue Apr 2, 2024
4c94065
Add: test_npz-file and changed it to pytest
OberGue Apr 2, 2024
9af5fd0
Add: test_order_manipulation and changed it to pytest
OberGue Apr 2, 2024
978f5d6
Add: test_orientation-file and changed it to pytest
OberGue Apr 2, 2024
2b3b21b
Add: test_property_modification-file and changed it to pytest; Fix: r…
OberGue Apr 2, 2024
63d47d9
Add: test_proximity-file and changed it to pytest
OberGue Apr 2, 2024
e220e90
Add: test_reparametrize-file and changed it to pytest
OberGue Apr 2, 2024
82a4d79
Add: test_spline_constructors-file and changed it to pytest
OberGue Apr 2, 2024
676c8fb
Fix: test_spline_constructors-file - typo in regex pattern resolved
OberGue Apr 2, 2024
a735547
Add: test_spline_type_conversion-file and changed it to pytest
OberGue Apr 7, 2024
a98055f
Add: data-folder with svg-files and test_svg-file and changed it to p…
OberGue Apr 7, 2024
09d7dba
Add: test_volume_integration-file and changed it to pytest
OberGue Apr 7, 2024
0207227
Fix: removed getfixturevalue where unnecessary
OberGue Apr 7, 2024
d20c837
Fix: test_property_modification-file is using todict() now
OberGue Apr 9, 2024
25e8df1
Fix: test_c_contiguous-file is using pytest.mark.parametrize and todi…
OberGue Apr 9, 2024
7a89871
Fix: getting rid of all dict- and list-fixtures in conftest-file
OberGue Apr 9, 2024
4b44b28
Fix: in conftest-file, are_items_close and -same fixtures simplified
OberGue Apr 9, 2024
01ee121
Fix: changed fixture-name get_queries_xD to queries_xD
OberGue Apr 9, 2024
367fc84
Fix: in test_mapping-file the pytest.raises-issue is solved now
OberGue Apr 9, 2024
5fc3425
Add/Fix: copied data-folder from unittest
OberGue Apr 9, 2024
c9c64bb
Fix: test_multipatch-file assertions now with np.all
OberGue Apr 9, 2024
c998d65
Fix: test_kv_manipulation - removed unnecessary comment
OberGue Apr 9, 2024
14b48c1
Add: in test_reparametrize-file, test_flip_axes-function was missing
OberGue Apr 9, 2024
1bf9ab1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 9, 2024
39cd6b7
keep directory structure for tests
j042 Apr 10, 2024
94233a9
remove SplineSetup
j042 Apr 10, 2024
cb5e882
simplify modifications
j042 Apr 10, 2024
2e03d5f
RF: Remove Geometry class replace by fixtures
clemens-fricke Apr 10, 2024
f30b3b5
RF: Fix paths in io test after directory changes
clemens-fricke Apr 10, 2024
05eb818
RF: evaluation test with parameterize
clemens-fricke Apr 10, 2024
0ca4547
Add: worklow add pytest tests
clemens-fricke Apr 10, 2024
dfaff77
fix test_kv_manipulation
j042 Apr 10, 2024
aee1515
RF: split big test into multiple smaller
clemens-fricke Apr 10, 2024
59c120a
RF: better assert error message
clemens-fricke Apr 10, 2024
6077c96
Fix: wrong message
clemens-fricke Apr 10, 2024
9decbed
use parametrize for reference values
j042 Apr 10, 2024
08478c6
update test name
j042 Apr 10, 2024
ad99774
Update test_pytest/helpme/test_extract.py
clemens-fricke Apr 10, 2024
64c6717
Fix: test package not installed
clemens-fricke Apr 10, 2024
628beef
split conversion tests
j042 Apr 10, 2024
a60412c
Fix: in test_spline_constructors-file renamed testfunctions
OberGue Apr 10, 2024
39f00b0
Add: test_multipatch-file had a missing code part
OberGue Apr 10, 2024
55a6820
Add: test_extract-file had a missing code part
OberGue Apr 10, 2024
91464f9
Add: test_gismo-file had missing code parts; Note: test fails
OberGue Apr 10, 2024
9c3cd5e
fix random
j042 Apr 11, 2024
6730da4
fix svg test
j042 Apr 11, 2024
1c9b7ee
remove unnecessary check
j042 Apr 11, 2024
bbe89f2
Fix: work in the remoarks from last code review
clemens-fricke Apr 11, 2024
20619bd
sync test_orientation
j042 Apr 11, 2024
ac94e8c
sync test_multipatch and remove unrelated parts
j042 Apr 11, 2024
34afcac
sync test_bezier_extraction
j042 Apr 11, 2024
5d5dbdf
Fix: Add floating point number comparison in text compare. Fixes the …
clemens-fricke Apr 11, 2024
f15f98f
add test for #395
j042 Apr 11, 2024
7a5286c
add test for #407
j042 Apr 11, 2024
80391e0
use pytest for testing
j042 Apr 11, 2024
91d0acc
replace unittest with pytest
j042 Apr 11, 2024
069cee9
add cls._loge
j042 Apr 11, 2024
990673e
remove conftest from ignore list
j042 Apr 11, 2024
5b90fe3
better specify test path
j042 Apr 11, 2024
82d5e3d
add __init__.py
j042 Apr 11, 2024
74924ca
add conftest.py
j042 Apr 11, 2024
dea410c
add cd
j042 Apr 11, 2024
f42e9ad
remove __all__ and udpate ci pytest call
j042 Apr 11, 2024
dbe98c8
install dev mode
j042 Apr 11, 2024
1550b38
Rf: remove pre python 3.8 exception to test due to those version not …
clemens-fricke Apr 12, 2024
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
5 changes: 2 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ jobs:
run: pip install numpy

- name: build splinepy linux
run: CC=clang-14 CXX=clang++-14 pip install . -v --config-settings=cmake.args=-DSPLINEPY_MORE=OFF
run: CC=clang-14 CXX=clang++-14 pip install -e".[test]" -v --config-settings=cmake.args=-DSPLINEPY_MORE=OFF

- name: test
run: |
pip install funi>=0.0.1
cd tests && python3 -m unittest discover . -v
pytest tests

- name: build docs
run: |
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@ jobs:
- name: build splinepy minimal/debug/warning
if: matrix.os != 'windows-latest'
run: |
pip install . -v --config-settings=cmake.args="-DSPLINEPY_MORE=OFF;-DSPLINEPY_ENABLE_WARNINGS=ON" --config-settings=cmake.build-type="Debug"
pip install -e ".[test]" -v --config-settings=cmake.args="-DSPLINEPY_MORE=OFF;-DSPLINEPY_ENABLE_WARNINGS=ON" --config-settings=cmake.build-type="Debug"

- name: build splinepy windows
if: matrix.os == 'windows-latest'
run: |
pip install . -v --config-settings=cmake.args="-DSPLINEPY_MORE=OFF"
pip install -e ".[test]" -v --config-settings=cmake.args="-DSPLINEPY_MORE=OFF"

- name: test
run: |
pip install funi>=0.0.1
cd tests && python3 -m unittest discover . -v
pytest tests
5 changes: 2 additions & 3 deletions .github/workflows/test_full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: build splinepy
run: pip install -e. -v
run: pip install -e".[test]" -v

- name: test
run: |
pip install funi>=0.0.1
cd tests && python3 -m unittest discover . -v
pytest
14 changes: 12 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ content-type = "text/markdown"

[project.optional-dependencies]
all = ["gustaf[all]>=0.0.22"]
test = ["funi>=0.0.1"]
test = ["funi>=0.0.1", "pytest"]

[project.scripts]
splinepy = "splinepy.cli:entry"
Expand All @@ -59,7 +59,7 @@ input = "splinepy/_version.py"

[tool.cibuildwheel]
test-extras = ["test"]
test-command = "python -m unittest discover {project}/tests -v"
test-command = "python -m pytest {project}/tests"

[tool.cibuildwheel.macos]
archs = ["x86_64", "arm64"]
Expand Down Expand Up @@ -118,3 +118,13 @@ exclude = "third_party"

[tool.blackdoc]
line-length = 75

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra"
testpaths = [
"tests",
]
filterwarnings = [
"ignore::DeprecationWarning:jupyter_client",
]
1 change: 1 addition & 0 deletions splinepy/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ def __init_subclass__(cls, *args, **kwargs):
cls._logw = _log.prepend_log(
"<" + cls.__qualname__ + ">", _log.warning
)
cls._loge = _log.prepend_log("<" + cls.__qualname__ + ">", _log.error)
return super().__new__(cls)
16 changes: 16 additions & 0 deletions splinepy/utils/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,22 @@ def warning(*log):
logger.warning(" ".join(map(str, log)))


def error(*log):
"""
error logger.

Parameters
-----------
*log: str

Returns
--------
None
"""
logger = _logging.getLogger("splinepy")
logger.error(" ".join(map(str, log)))


def prepend_log(message, log_func):
"""
Prepend message before a logging function.
Expand Down
Empty file added tests/__init__.py
Empty file.
Loading
Loading