Skip to content

Commit

Permalink
Edit test.yml and skip CI test
Browse files Browse the repository at this point in the history
  • Loading branch information
DanicaSTFC committed Aug 6, 2024
1 parent 325bd5e commit 5124254
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
24 changes: 2 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion test/test_NoBorderScrollArea.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 5124254

Please sign in to comment.