Skip to content

Commit 36ecea1

Browse files
committed
update xvfb configuration; remove X11 marks
1 parent 6ff2e9b commit 36ecea1

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

.github/workflows/control-slycot-src.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ jobs:
1515
# Set up conda
1616
echo $CONDA/bin >> $GITHUB_PATH
1717
18+
# Set up (virtual) X11
19+
sudo apt install -y xvfb
20+
1821
# Install test tools
19-
conda install pip pytest
22+
conda install pip pytest
2023
2124
# Install python-control dependencies
2225
conda install numpy matplotlib scipy
@@ -33,4 +36,4 @@ jobs:
3336
cd slycot; python setup.py build_ext install -DBLA_VENDOR=Generic
3437
3538
- name: Test with pytest
36-
run: pytest control/tests
39+
run: xvfb-run --auto-servernum pytest control/tests

.github/workflows/python-package-conda.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ jobs:
2323
run: |
2424
# Set up conda
2525
echo $CONDA/bin >> $GITHUB_PATH
26-
conda create -q -n test-environment python=${{matrix.python-version}}
26+
conda create -q -n test-environment python=${{matrix.python-version}}
2727
source $CONDA/bin/activate test-environment
2828
2929
# Set up (virtual) X11
3030
sudo apt install -y xvfb
3131
3232
# Install test tools
33-
conda install pip coverage pytest
34-
conda install -c conda-forge pytest-xvfb pytest-cov
33+
conda install pip coverage pytest
34+
conda install -c conda-forge pytest-cov
3535
3636
# Install python-control dependencies
3737
conda install numpy matplotlib scipy
@@ -43,4 +43,6 @@ jobs:
4343
PYTHON_CONTROL_ARRAY_AND_MATRIX: ${{ matrix.array-and-matrix }}
4444
run: |
4545
source $CONDA/bin/activate test-environment
46+
# Use xvfb-run instead of pytest-xvfb to get proper mpl backend
47+
# See https://github.com/python-control/python-control/pull/504
4648
xvfb-run --auto-servernum pytest control/tests

control/tests/conftest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
"PendingDeprecationWarning")
2727
matrixerrorfilter = pytest.mark.filterwarnings("error:.*matrix subclass:"
2828
"PendingDeprecationWarning")
29-
X11only = pytest.mark.skipif(os.getenv("DISPLAY") is None,
30-
reason="requires X11")
29+
3130

3231
@pytest.fixture(scope="session", autouse=True)
3332
def control_defaults():

control/tests/rlocus_test.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
from control.statesp import StateSpace
1414
from control.bdalg import feedback
1515

16-
from control.tests.conftest import X11only
17-
1816

1917
class TestRootLocus:
2018
"""These are tests for the feedback function in rlocus.py."""
@@ -50,7 +48,6 @@ def test_without_gains(self, sys):
5048
roots, kvect = root_locus(sys, plot=False)
5149
self.check_cl_poles(sys, roots, kvect)
5250

53-
@X11only
5451
def test_root_locus_zoom(self):
5552
"""Check the zooming functionality of the Root locus plot"""
5653
system = TransferFunction([1000], [1, 25, 100, 0])

control/tests/sisotool_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from control.rlocus import _RLClickDispatcher
1010
from control.xferfcn import TransferFunction
1111

12-
from control.tests.conftest import X11only
1312

1413
@pytest.mark.usefixtures("mplcleanup")
1514
class TestSisotool:
@@ -20,7 +19,6 @@ def sys(self):
2019
"""Return a generic SISO transfer function"""
2120
return TransferFunction([1000], [1, 25, 100, 0])
2221

23-
@X11only
2422
def test_sisotool(self, sys):
2523
sisotool(sys, Hz=False)
2624
fig = plt.gcf()

0 commit comments

Comments
 (0)