Skip to content

Commit 8b67a2c

Browse files
Bump version 0.12.1
1 parent 66887a9 commit 8b67a2c

File tree

4 files changed

+41
-5
lines changed

4 files changed

+41
-5
lines changed

doc/changelog.d/2337.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Decorator order issue

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ requires = [ "flit-core>=3.2,<4" ]
44

55
[project]
66
name = "ansys-geometry-core"
7-
version = "0.12.0"
7+
version = "0.12.1"
88
description = "A python wrapper for Ansys Geometry service"
99
readme = "README.rst"
1010
license = "MIT"

src/ansys/geometry/core/connection/launcher.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,8 @@ def launch_modeler_with_spaceclaim_and_pimlight(
497497
)
498498

499499

500-
@kwargs_passed_not_accepted
501500
@deprecated_argument("product_version", "version", version="0.10.8", remove="0.13.0")
501+
@kwargs_passed_not_accepted
502502
def launch_modeler_with_geometry_service(
503503
version: str | int | None = None,
504504
host: str = "localhost",
@@ -620,8 +620,8 @@ def launch_modeler_with_geometry_service(
620620
)
621621

622622

623-
@kwargs_passed_not_accepted
624623
@deprecated_argument("product_version", "version", version="0.10.8", remove="0.13.0")
624+
@kwargs_passed_not_accepted
625625
def launch_modeler_with_discovery(
626626
version: str | int | None = None,
627627
host: str = "localhost",
@@ -741,8 +741,8 @@ def launch_modeler_with_discovery(
741741
)
742742

743743

744-
@kwargs_passed_not_accepted
745744
@deprecated_argument("product_version", "version", version="0.10.8", remove="0.13.0")
745+
@kwargs_passed_not_accepted
746746
def launch_modeler_with_spaceclaim(
747747
version: str | int | None = None,
748748
host: str = "localhost",
@@ -862,8 +862,8 @@ def launch_modeler_with_spaceclaim(
862862
)
863863

864864

865-
@kwargs_passed_not_accepted
866865
@deprecated_argument("product_version", "version", version="0.10.8", remove="0.13.0")
866+
@kwargs_passed_not_accepted
867867
def launch_modeler_with_core_service(
868868
version: str | int | None = None,
869869
host: str = "localhost",

tests/test_misc_checks.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,3 +439,38 @@ def my_method(arg1, arg2, **kwargs):
439439
match="The following keyword arguments are not accepted in the method 'my_method': arg3.",
440440
):
441441
my_method(arg1=1, arg2=2, arg3=3)
442+
443+
444+
def test_kwargs_passed_not_accepted_decorator_order():
445+
"""Test the kwargs_passed_not_accepted decorator."""
446+
447+
@deprecated_argument("arg3")
448+
@kwargs_passed_not_accepted
449+
def my_method(arg1, arg2, **kwargs):
450+
"""A method that accepts no keyword arguments."""
451+
return arg1 + arg2
452+
453+
# Call the method without kwargs - should not raise an error
454+
assert my_method(1, 2) == 3
455+
assert my_method(arg1=1, arg2=2) == 3
456+
457+
# Call the method with kwargs - should raise an error
458+
with pytest.raises(
459+
TypeError,
460+
match="The following keyword arguments are not accepted in the"
461+
" method 'my_method': unexpected_arg, another_one.",
462+
):
463+
my_method(1, 2, unexpected_arg=3, another_one="test")
464+
465+
with pytest.raises(
466+
TypeError,
467+
match="The following keyword arguments are not accepted in the method 'my_method': arg3.",
468+
):
469+
my_method(arg1=1, arg2=2, arg3=3)
470+
471+
# TODO: This test fails, fix decorator #2338
472+
# @kwargs_passed_not_accepted
473+
# @deprecated_argument("arg3")
474+
# def my_method(arg1, arg2, **kwargs):
475+
# """A method that accepts no keyword arguments."""
476+
# return arg1 + arg2

0 commit comments

Comments
 (0)