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
26 changes: 26 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[run]
source = vspace
omit =
*/tests/*
*/test_*
*/__pycache__/*
*/vspace_version.py
concurrency = multiprocessing
parallel = True
sigterm = True

[report]
precision = 2
show_missing = True
skip_covered = False

exclude_lines =
pragma: no cover
def __repr__
raise AssertionError
raise NotImplementedError
if __name__ == .__main__.:
@abstract

[html]
directory = htmlcov
19 changes: 18 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,28 @@ jobs:
echo "Running single unit test as diagnostic..."
python -m pytest tests/Vspace_Explicit/test_vspace_explicit.py -v -s

- name: Enable subprocess coverage
run: |
# Install coverage subprocess support
echo "import coverage; coverage.process_startup()" > $(python -c "import site; print(site.getsitepackages()[0])")/coverage_subprocess.pth
# Set environment variable for coverage configuration
echo "COVERAGE_PROCESS_START=${{ github.workspace }}/.coveragerc" >> $GITHUB_ENV

- name: Run tests
timeout-minutes: 20
run: |
# Run all tests with verbose output, capture disabled to see subprocess output, and per-test timeout
python -m pytest tests/ -v -s --timeout=300 --junitxml=junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml --cov=vspace --cov-report=xml --cov-report=term
python -m pytest tests/ -v -s --timeout=300 --junitxml=junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml --cov --cov-report=xml --cov-report=term

- name: Combine coverage data
if: matrix.os == 'ubuntu-22.04' && matrix.python-version == '3.9'
run: |
# Move all coverage files from subdirectories to repository root
find tests/ -name ".coverage.*" -type f -exec mv {} . \; 2>/dev/null || true
# Combine all coverage data files
python -m coverage combine
python -m coverage xml
python -m coverage report

- name: Upload coverage to Codecov
# Only upload from one runner to avoid redundant API calls
Expand Down
3 changes: 0 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('sphinx_rtd_theme'))
import sphinx_rtd_theme


# -- Project information -----------------------------------------------------
Expand Down Expand Up @@ -50,7 +48,6 @@
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down
49 changes: 49 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[pytest]
# Pytest configuration for vspace

# Test discovery patterns
python_files = test_*.py
python_classes = Test*
python_functions = test_*

# Test options
addopts =
--verbose
--strict-markers
--cov-context=test

# Coverage configuration for subprocess tracking
[coverage:run]
source = vspace
omit =
*/tests/*
*/test_*
*/__pycache__/*
*/vspace_version.py
concurrency = multiprocessing
parallel = True

[coverage:report]
precision = 2
show_missing = True
skip_covered = False

exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code
def __repr__

# Don't complain if tests don't hit defensive assertion code
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run
if __name__ == .__main__.:

# Don't complain about abstract methods
@abstract

[coverage:html]
directory = htmlcov