diff --git a/pyproject.toml b/pyproject.toml index 6c05bdd7..db383e14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,8 +47,6 @@ exclude_lines = [ omit = [ "*/__init__.py", "*/tests/*", - "*/hardware/*", - "*/pyzbar/*", ] skip_covered = false skip_empty = true diff --git a/tests/README.md b/tests/README.md index e948cfba..adc596c8 100644 --- a/tests/README.md +++ b/tests/README.md @@ -67,23 +67,17 @@ Run tests and generate test coverage coverage run -m pytest ``` -The screenshots have to be run separately, but they can also add to overall coverage: - +The screenshots can generate their own separate coverage report: ```bash coverage run -m pytest tests/screenshot_generator/generator.py --locale es ``` -Each run creates its own `.coverage.*` results file. Merge them into one result with: -```bash -coverage combine -``` - Show the resulting test coverage details: ```bash coverage report ``` -Generate the html overview: +Generate the interactive html report: ```bash coverage html -``` +``` \ No newline at end of file diff --git a/tests/run_full_coverage.sh b/tests/run_full_coverage.sh index 0eca3f00..5df87b96 100755 --- a/tests/run_full_coverage.sh +++ b/tests/run_full_coverage.sh @@ -1,15 +1,19 @@ #!/bin/bash -# Run the full test suite -coverage run -m pytest +# Clean up any prior coverage results +coverage erase + +# Run the full test suite; `--parallel` writes coverage results to a separate file +# (otherwise it'll be overwritten in the next step) +coverage run --parallel -m pytest # Generate screenshots (only need to run for one locale to assess coverage) -coverage run -m pytest tests/screenshot_generator/generator.py --locale es +coverage run --parallel -m pytest tests/screenshot_generator/generator.py --locale es -# Combine the above coverage results; also cleans up any prior .coverage.* results files +# Combine the above coverage results coverage combine -# Show the cli report +# Show the report in the terminal coverage report # Generate the interactive html report