Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bcdennis/pythonsqa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python SQA Project

A Python project starter kit with testing, linting, and code quality tools configured.

Getting Started

Prerequisites

  • Python 3.10 or higher
  • Poetry (Python package manager)

If you don't have Poetry installed:

curl -sSL https://install.python-poetry.org | python3 -

Installation

  1. Clone this repository
  2. Install dependencies:
    poetry install
  3. Set up pre-commit hooks (runs checks automatically before each commit):
    poetry run pre-commit install

Development Workflow

Running Tests

Run all tests:

poetry run pytest

Run tests with coverage report:

poetry run pytest --cov

Run tests in parallel (faster):

poetry run pytest -n auto

Code Quality Checks

Linting (check for code issues):

poetry run ruff check .

Auto-fix issues:

poetry run ruff check . --fix

Formatting (standardize code style):

poetry run ruff format .

Type Checking (catch type-related bugs):

poetry run mypy .

Security Scanning (find potential vulnerabilities):

poetry run bandit -r src pythonsqa

Pre-commit Hooks

Once installed, pre-commit hooks automatically run before each commit to check:

  • Code formatting (ruff)
  • Linting (ruff)
  • Type checking (mypy)
  • Security issues (bandit)

If any check fails, the commit will be blocked. Fix the issues and try again.

Project Structure

pythonsqa/
├── src/              # Source code goes here
├── tests/            # Test files (test_*.py)
├── pyproject.toml    # Project configuration and dependencies
└── README.md         # This file

Writing Tests

Place test files in the tests/ directory with names starting with test_:

# tests/test_example.py
def test_addition():
    assert 1 + 1 == 2

Run your specific test file:

poetry run pytest tests/test_example.py

Common Commands

Task Command
Install dependencies poetry install
Run tests poetry run pytest
Check code style poetry run ruff check .
Format code poetry run ruff format .
Type check poetry run mypy .
Security scan poetry run bandit -r src pythonsqa

Getting Help

  • Check tool documentation if you encounter errors
  • Ask your team lead for clarification
  • Review test examples in the tests/ directory

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages