Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/control-slycot-src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
sudo apt install -y xvfb

# Install test tools
conda install pip pytest
conda install pip pytest pytest-timeout

# Install python-control dependencies
conda install numpy matplotlib scipy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
sudo apt install -y xvfb

# Install test tools
conda install pip coverage pytest
conda install pip coverage pytest pytest-timeout
pip install coveralls

# Install python-control dependencies
Expand Down
10 changes: 2 additions & 8 deletions control/tests/rlocus_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def test_root_locus_zoom(self):
assert_array_almost_equal(zoom_x, zoom_x_valid)
assert_array_almost_equal(zoom_y, zoom_y_valid)

@pytest.mark.timeout(2)
def test_rlocus_default_wn(self):
"""Check that default wn calculation works properly"""
#
Expand All @@ -94,12 +95,5 @@ def test_rlocus_default_wn(self):
sys = ct.tf(*sp.signal.zpk2tf(
[-1e-2, 1-1e7j, 1+1e7j], [0, -1e7j, 1e7j], 1))

# Set up a timer to catch execution time
def signal_handler(signum, frame):
raise Exception("rlocus took too long to complete")
signal.signal(signal.SIGALRM, signal_handler)

# Run the command and reset the alarm
signal.alarm(2) # 2 second timeout
ct.root_locus(sys)
signal.alarm(0) # reset the alarm

3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,7 @@
install_requires=['numpy',
'scipy',
'matplotlib'],
extras_require={
'test': ['pytest', 'pytest-timeout'],
}
)