python-tests
Skill73 starsChanged 56 days agoApache-2.0View on GitHub
Python tests for NeMo Fabric; use this when writing tests
3 other projects use a version of this.
Adopted by
Most recently taken up by
- PrefectHQ/fastmcptheir own version, first seen Oct 8, 2026
- jlowin/fastmcptheir own version, first seen Oct 8, 2026
- josegcpa/.agentstheir own version, first seen Sep 4, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- PrefectHQ/fastmcp★ 28ksame name
- jlowin/fastmcp★ 28ksame name
- josegcpa/.agents★ 0same name
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 repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- check-release-deploymentsSkill
- contribute-adapterSkill
- contribute-apiSkill
- contribute-docsSkill
- create-beta-tagSkill
- create-rc-tagSkill
- create-release-tagSkill
- draft-release-notesSkill
- karpathy-guidelinesSkill
- maintain-ciSkill
- maintain-packagingSkill
- prepare-code-freezeSkill
- prepare-prSkill
- qualify-harborSkill
- review-doc-styleSkill
- small-fixSkill
- update-project-versionSkill
- validate-changeSkill
- code-reviewSkill
- swebench-debuggingSkill
- nemo-fabric-build-adapterSkill
- nemo-fabric-integrateSkill
- alternateSkill
- defaultSkill
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 4 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Do not add @pytest.mark.asyncio to any test.
- Very specific: line 13
Do not add a -> None return type annotation to test functions.
- Very specific: line 14
When mocking a class, do not define a new class.
- Distinctive: line 16
Prefer pytest fixtures over helper methods.
- Very specific: line 17
Do not repeat fixtures, if a fixture is needed in multiple test files, place it in a conftest.py file.
- Distinctive: line 18
When creating a fixture follow this pattern:
- Distinctive: line 24
Only specify the scope argument when the value is something other than "function".
- Very specific: line 25
Prefer pytest.mark.parametrize over creating individual tests for different input types.
- Very specific: line 27
If a fixture is needed for a test, but either does not return a value or the value is not used in the test, use the …
- Distinctive: line 29
Avoid defensive programming in tests.
- Very specific: line 52
Test helper code under tests/_utils/.
“Common” is measured: kept by at least 6 in 10 of the 3 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
Python Test Style
- Pytest is used to run tests.
- Do not add
@pytest.mark.asyncioto any test. Async tests are automatically detected and run by the async runner; the decorator is unnecessary clutter. - Do not add a
-> Nonereturn type annotation to test functions. This is not a common convention in pytest and adds unnecessary verbosity. - When mocking a class, do not define a new class. Use
unittest.mock.MagicMockorunittest.mock.AsyncMock, with thespecconstructor argument when necessary. - The name of the mocked class should be prefixed with
mock, notfake. - Prefer pytest fixtures over helper methods.
- Do not repeat fixtures, if a fixture is needed in multiple test files, place it in a
conftest.pyfile. - When creating a fixture follow this pattern:
Only specify the scope argument when the value is something other than "function".@pytest.fixture(name="<fixture_name>"[, scope="<scope>"]) def <fixture_name>_fixture() -> <return_type>: ... - Prefer
pytest.mark.parametrizeover creating individual tests for different input types. - If a fixture is needed for a test, but either does not return a value or the value is not used in the test, use the
@pytest.mark.usefixturesdecorator. tests/conftest.pycontains arestore_environ_fixturefixture that restores the environment variables to their original state after each test, it is defined withautouse=Trueso it is automatically applied to all tests. If you need to modify the environment variables in a test, do so usingos.environand the fixture will restore them after the test completes. There is no need to usemonkeypatch.setenvto modify environment variables in tests.- Avoid defensive programming in tests. If a test fails, it should fail loudly and clearly, rather than silently passing due to defensive checks. For example
is preferred overdata = results["data"]
Simply allow the resulting KeyError to be raised if the "data" key is not present in the results dictionary, as this will provide a clear indication of what went wrong in the test.data = results.get("data")
Common Commands
# Focused test loop
uv run pytest -k "<pattern>"
# Run all tests
uv run pytestDo Not Write Tests For
- Documentation.
- Test helper code under
tests/_utils/. - Package metadata or wheel installation behavior.
References
pyproject.tomltests/conftest.py
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.

