Skip to content

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pytest Testing Skill (Codex/ChatGPT)

This skill provides focused guidance, code recipes, and a project initializer for pytest. It helps you:

  • Add or refactor tests with clear structure and naming
  • Use fixtures, parametrization, and marks effectively
  • Mock dependencies (monkeypatch, pytest-mock) and isolate IO with tmp_path
  • Test async code, CLIs, web apps (FastAPI, Flask, Django), and pandas/SQLAlchemy logic
  • Configure coverage, flaky tests, xfail/skip, and CI integration

See SKILL.md for the skill definition, guides.md for quick how‑tos, and recipes.md for copy‑paste patterns.

Install as a Codex Skill

Codex CLI treats any folder under ~/.codex/skills/ with a valid SKILL.md as a skill.

Clone this repository into your skills directory (example path uses a short folder name):

git clone https://github.com/allthingssecurity/codex-skill-pytest \
  ~/.codex/skills/pytest-testing

Start Codex with skills enabled and verify:

codex --enable skills -m gpt-5.2
list skills

Expected entry:

- pytest-testing — Create and maintain tests with pytest ...
  (file: ~/.codex/skills/pytest-testing/SKILL.md)

Trigger Prompt (Simple)

Paste one of these into Codex to invoke this skill:

  • "Use the pytest-testing skill to initialize pytest with coverage and CI in this folder."
  • "Run the pytest-testing skill and add tests for my functions in src/yourpkg."
  • "Initialize pytest (pytest.ini, conftest.py, .coveragerc) using the pytest-testing skill and set up a GitHub Actions workflow."

After Codex acknowledges the skill, it will typically run init_pytest.py and scaffold the files.

Manual Use (without skills)

You can run the initializer script directly from this repo:

python3 skill-pytest/init_pytest.py --ci --package yourpkg
python3 -m pip install -r requirements-dev.txt
pytest -q --cov

Arguments:

  • --ci adds .github/workflows/python-tests.yml
  • --package yourpkg sets coverage source = yourpkg
  • --overwrite updates existing files if present

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages