How to run tests locally¶
Use this guide to run the current pytest suite, generate the coverage artifacts used by the docs build, and choose the right markers during local work.
๐ง Prerequisites¶
- A synced workspace with the
testextra installed - Windows and Excel only if you intend to opt into Excel-marked tests
๐ Steps¶
-
Run the default local suite.
-
Generate the coverage files consumed by the documentation workflow.
-
Use a
poetask when you want a preset test mode.
๐งช Current suite¶
- Unit tests for converters, formatters, exceptions, exported symbols, and GUI protocols
- Unit tests for the CLI (
click.testing.CliRunner) and the COM error-translation helpers - Marker registration for
unit,integration,slow,cli, andexcel - Committed Excel scenarios behind
@pytest.mark.excel
๐งช Current repository scope
Every committed test lives in tests/unit/. The COM proxies in core/ are
excluded from the coverage gate because they need a running Excel; everything
else is measured. A test that does need Excel is marked @pytest.mark.excel
wherever it sits, which is what keeps it out of CI โ the directory it lives in
plays no part.
โ๏ธ Add a new test¶
Mark each new test explicitly so selection stays predictable:
Use @pytest.mark.excel only for tests that require a live Excel installation, and keep those scenarios out of the default local run.
โ Result¶
You can run the default suite, produce coverage.xml for the docs build, and choose markers that match the repository's existing test contract.