Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteb2b492

Browse files
author
Rory Yorke
committed
Replace test decorator cvxoptonly with pytest mark cvxopt
The pytest marker cvxopt is equivalent to the cvxoptonly decorator,and also allows cvxopt tests to be included or excluded at the pytestcommand-line.
1 parent4be4767 commiteb2b492

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

‎control/tests/conftest.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ def pytest_runtest_setup(item):
1515
formarkinitem.iter_markers())):
1616
pytest.skip("slycot not installed")
1717

18+
if (notcontrol.exception.cvxopt_check()
19+
andany(mark.name=='cvxopt'
20+
formarkinitem.iter_markers())):
21+
pytest.skip("cvxopt not installed")
22+
1823

1924
@pytest.fixture(scope="session",autouse=True)
2025
defcontrol_defaults():

‎control/tests/passivity_test.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
importpytest
66
importnumpy
77
fromcontrolimportss,passivity,tf,sample_system,parallel,feedback
8-
fromcontrol.tests.conftestimportcvxoptonly
98
fromcontrol.exceptionimportControlArgument,ControlDimension
109

11-
pytestmark=cvxoptonly
10+
pytestmark=pytest.mark.cvxopt
1211

1312

1413
deftest_ispassive_ctime():

‎pytest.ini‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[pytest]
22
markers =
33
slycot: tests needing slycot
4+
cvxopt: tests needing cvxopt

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp