Skip to content

Latest commit

 

History

History
53 lines (39 loc) · 1.18 KB

File metadata and controls

53 lines (39 loc) · 1.18 KB

Python API Testing - JSONPlaceholder

API Tests

REST API test automation suite using Python, pytest, and requests library. Tests the JSONPlaceholder fake REST API to demonstrate API testing skills.

Setup

# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install dependencies
uv sync

Run Tests

# Run all tests
uv run pytest -v

# Run specific test file
uv run pytest tests/test_posts.py -v

CI/CD

This project uses GitHub Actions for continuous integration. Tests run automatically on:

  • Every push to main branch
  • Every pull request to main branch

Workflow Details

The CI pipeline:

  1. Sets up Python 3.9 environment
  2. Installs uv package manager
  3. Installs project dependencies
  4. Runs all tests with pytest
  5. Uploads test results as artifacts on failure

See .github/workflows/api-tests.yml for full workflow configuration.

Project Structure

tests/
├── helpers/          # Helper functions and utilities
└── test_posts.py    # Tests for /posts endpoint

Technologies

  • Python 3.9+
  • pytest
  • requests