diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3dfcfa0..ad2be73 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,9 +1,7 @@ name: Test - on: push: pull_request: - jobs: test: if: github.event_name != 'pull_request' || !contains('OWNER,MEMBER,COLLABORATOR', github.event.pull_request.author_association) @@ -16,29 +14,11 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - - - name: Install dependencies - run: | - pip install -U .[dev] - pip install pytest pytest-qt # Ensure pytest-qt is installed for Qt tests - - # Add this step to install Xvfb - - name: Set up Xvfb - run: | - sudo apt-get update - sudo apt-get install -y xvfb - - # Modify the existing pytest run step to use Xvfb - - name: Run tests - env: - DISPLAY: :99.0 # Set the display environment variable for Xvfb - run: | - xvfb-run -a pytest --maxfail=1 --disable-warnings -q - + - run: pip install -U .[dev] + - run: pytest deploy: needs: [test] name: PyPI Deploy diff --git a/test/test_NoBorderScrollArea.py b/test/test_NoBorderScrollArea.py index 6efe444..d3d21c0 100644 --- a/test/test_NoBorderScrollArea.py +++ b/test/test_NoBorderScrollArea.py @@ -4,9 +4,13 @@ from eqt.ui.NoBorderScrollArea import NoBorderScrollArea +from . import is_ci, skip + +if is_ci: + skip("Running in CI (no GUI)", allow_module_level=True) -class TestNoBorderScrollArea(unittest.TestCase): +class TestNoBorderScrollArea(unittest.TestCase): def setUp(self): '''Initialises a NoBorderScrollArea widget and adds it to a layout.''' self.main_widget = QWidget()