Skip to content

Fix UnboundLocalError: rename throwaway variables to avoid shadowing … #441

Fix UnboundLocalError: rename throwaway variables to avoid shadowing …

Fix UnboundLocalError: rename throwaway variables to avoid shadowing … #441

Workflow file for this run

name: DDT4ALL APP
on:
push:
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.x"]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
# Linux only: install xvfb
- name: Install system deps (Qt headless - Linux only)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb libbluetooth-dev bluetooth
- name: Install project (pyproject.toml + dev deps)
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev,can,network,bluetooth]" --no-warn-script-location
# Run tests on Linux with xvfb
- name: Run tests with coverage (Linux)
if: runner.os == 'Linux'
env:
QT_QPA_PLATFORM: offscreen
run: |
xvfb-run -a pytest --cov=ddt4all --cov-report=term-missing --cov-report=xml
# Run tests on macOS and Windows
- name: Run tests with coverage (macOS / Windows)
if: runner.os != 'Linux'
env:
QT_QPA_PLATFORM: offscreen
run: |
pytest --cov=ddt4all --cov-report=term-missing --cov-report=xml
# Optional: upload coverage
# - name: Upload coverage to Codecov
# if: ${{ !cancelled() }}
# uses: codecov/codecov-action@v4
# with:
# files: coverage.xml
# fail_ci_if_error: true
# token: ${{ secrets.CODECOV_TOKEN }}