python-testing
Skill0 starsChanged 8 months agoMITView on GitHub
Write and run Python tests for the VoxelPic library. USE FOR: adding new pytest test cases, understanding the Python API and test patterns, debugging Python test failures, or running the existing Python test suite.
- Installs packages
33 other projects use a version of this.
Adopted by
Most recently taken up by
- fmind/dottheir own version, first seen Oct 5, 2026
- ComposioHQ/composiotheir own version, first seen Sep 29, 2026
- templetongroup/radianttheir own version, first seen Sep 17, 2026
- IAbuElRuzz/AgentSkillstheir own version, first seen Sep 16, 2026
- Paldom/python-skillstheir own version, first seen Sep 10, 2026
- konstruktoid/agent-instructions-skillstheir own version, first seen Aug 24, 2026
Used with
Projects with it also use swift-protocol-di-testing, springboot-tdd and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
InfopibeSkillswift-protocol-di-testing
Protocol-based dependency injection for testable Swift code — mock file system, network, and external APIs using focused protocols and Swift Testing.
Also in 6 projects that use this
FaisalAlqarniSkillspringboot-tdd
Test-driven development for Spring Boot using JUnit 5, Mockito, MockMvc, Testcontainers, and JaCoCo. Use when adding features, fixing bugs, or refactoring.
Also in 9 projects that use this
FaisalAlqarniSkilldjango-verification
Verification loop for Django projects: migrations, linting, tests with coverage, security scans, and deployment readiness checks before release or PR.
Also in 9 projects that use this
InfopibeSkillswift-actor-persistence
Thread-safe data persistence in Swift using actors — in-memory cache with file-backed storage, eliminating data races by design.
Also in 6 projects that use this
johnrtiptonSkilldjango-security
This skill should be used when conducting security reviews, auditing Django applications, hardening security settings, implementing OWASP Top 10 protections, managing secrets, or ensuring multi-tenant security isolation. Provides automated security auditor that scans settings, code, dependencies, and multi-tenant configurations with auto-fix capabilities.
Also in 9 projects that use this
joneqianSkillpostgres-patterns
PostgreSQL database patterns for query optimization, schema design, indexing, and security. Based on Supabase best practices.
Also in 12 projects that use this
- +1 more from FaisalAlqarni
- +3 more from Infopibe
Other versions33 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 33
- ComposioHQ/composio★ 30ksame name
- microsoft/agent-framework★ 14ksame name
- xu-xiang/everything-claude-code-zh★ 2ksame name
- loulanyue/awesome-claude-notes★ 272same name
- Mindrally/skills★ 266same name
- tpavanipradeep/everything-claude-code★ 134same name
- templetongroup/radiant★ 113same name
- Jamkris/everything-gemini-code★ 87same name
- codelably/harmony-claude-code★ 43same name
- noah-sheldon/ai-dev-kit★ 13same name
23 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository3 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- bump-versionSkill
- c-testingSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 1 is distinctive, and 5 are very specific to this project.
0
Common
Most of the 28 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 68
Add tests to test/test_python_api.py (or create a new test/test_*.py file).
- Very specific: line 90
Use @pytest.mark.parametrize for depth variation:
- Distinctive: line 100
Use NumPy testing assertions for array comparisons:
- Very specific: line 107
Use standard assert for scalar values:
- Very specific: line 116
Use pytest built-in fixtures.
- Very specific: line 126
No custom fixtures or conftest.py exist — tests are self-contained.
“Common” is measured: kept by at least 6 in 10 of the 28 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Testing the Python Library
Test Suite Overview
Python tests live in test/test_python_api.py and run with pytest. The test
file exercises the public API exposed by the voxelpic package — encode,
decode, image_shape, voxel_size, PointCloud, and DecodeResult — which
delegate to the _voxelpic C extension module.
| Test Function | Parametrized | What It Tests |
test_transcode | depth 7,8,9 | Full encode → decode → re-encode round-trip |
test_io | no | PointCloud.save() / PointCloud.load() binary I/O |
Installing and Running
pip install -e .[test] # editable install with test dependencies
pytest -vv # run all tests from repo rootThe [test] extra installs pytest, pytest-md, pytest-emoji, and
pytest-cov.
Useful Commands
pytest test/test_python_api.py -vv # run only Python tests
pytest test/test_python_api.py::test_transcode -vv # single test function
pytest test/test_python_api.py::test_transcode[9] # single parametrized case
pytest --cov=voxelpic --cov-report=term-missing # with coveragePython API Surface
The C extension _voxelpic exposes four functions consumed by src/voxelpic.py:
| C Extension Function | Python Wrapper | Purpose |
_voxelpic.encode() | voxelpic.encode() | Point cloud → RGBA image |
_voxelpic.decode() | voxelpic.decode() | RGBA image → DecodeResult |
_voxelpic.image_shape() | voxelpic.image_shape() | Image (height, width) for a depth |
_voxelpic.voxel_size() | voxelpic.voxel_size() | Voxel side length for a depth |
Key Types
PointCloud—NamedTuplewithpositions(Nx4 float32) andcolors(Nx4 uint8). Hasto3()/to4()conversion methods andsave()/load()for binary I/O.DecodeResult—NamedTuplewithpositions,colors,count,depth. Has a.cloudproperty that returns aPointCloud.
Array Constraints (validated in the C extension)
- Positions: Nx4, dtype
float32, C-contiguous. - Colors: Nx4, dtype
uint8, C-contiguous. - Images: HxWx4, dtype
uint8, C-contiguous. - Position and color arrays must have the same N dimension.
Conventions for Writing a New Test
File and Imports
Add tests to test/test_python_api.py (or create a new test/test_*.py file).
import numpy as np
import voxelpic as vp
import pytestGenerating Test Data
Tests generate random data inline rather than reading from files:
positions = np.random.rand(1000, 4).astype(np.float32) * 2 - 1
positions[:, 3] = 1 # homogeneous w coordinate
colors = np.random.randint(0, 255, (1000, 4)).astype(np.uint8)
colors[:, 3] = 255 # alpha channel
cloud = vp.PointCloud(positions, colors)Parametrization
Use @pytest.mark.parametrize for depth variation:
@pytest.mark.parametrize("depth", [7, 8, 9])
def test_something(depth):
...Assertions
Use NumPy testing assertions for array comparisons:
np.testing.assert_array_equal(actual, expected) # exact (uint8, int)
np.testing.assert_array_almost_equal(actual, expected) # float toleranceUse standard assert for scalar values:
assert result.depth == depth
assert image.shape == (height, width, 4)Fixtures
Use pytest built-in fixtures. tmp_path provides a temporary directory per
test, useful for I/O tests:
def test_io(tmp_path):
path = str(tmp_path / "cloud.dat")
cloud.save(path)
loaded = vp.PointCloud.load(path)No custom fixtures or conftest.py exist — tests are self-contained.
Round-Trip Testing Pattern
The primary pattern is encode → decode → re-encode, verifying that the second encode produces an identical image:
image = vp.encode(cloud, depth=depth)
result = vp.decode(image)
image2 = vp.encode(result.cloud, depth=depth)
np.testing.assert_array_equal(image, image2)Testing Preallocated Buffers
Both encode and decode accept optional preallocated output arrays. Test both
the default allocation path and the preallocated path:
# Default allocation
image = vp.encode(cloud, depth=depth)
# Preallocated output
h, w = vp.image_shape(depth)
out = np.empty((h, w, 4), dtype=np.uint8)
image2 = vp.encode(cloud, depth=depth, out_image=out)Configuration
There is no pytest.ini, conftest.py, or [tool.pytest.ini_options] section.
Pytest uses default discovery: files matching test_*.py with functions matching
test_*.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

