Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Add a skeleton of the pytest plugin (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
nedtwigg authored Apr 4, 2024
2 parents eb3e99c + fc452ca commit 635f1df
Show file tree
Hide file tree
Showing 17 changed files with 1,171 additions and 4 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
pull_request:
paths:
- "python/**"
defaults:
run:
working-directory: python/selfie-lib
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -27,6 +24,28 @@ jobs:
python-version-file: "python/selfie-lib/pyproject.toml"
cache: "poetry"
- run: poetry install
working-directory: python/selfie-lib
- run: poetry run pytest -vv
working-directory: python/selfie-lib
- run: poetry run pyright
working-directory: python/selfie-lib
- run: poetry run ruff format --check
working-directory: python/selfie-lib
- run: poetry install
working-directory: python/pytest-selfie
- run: poetry run pytest -vv
working-directory: python/pytest-selfie
- run: poetry run tox -e py
working-directory: python/pytest-selfie
- run: poetry run pyright
working-directory: python/pytest-selfie
- run: poetry run ruff format --check
working-directory: python/pytest-selfie
- run: poetry install
working-directory: python/example-pytest-selfie
- run: poetry run pytest -vv
working-directory: python/example-pytest-selfie
- run: poetry run pyright
working-directory: python/example-pytest-selfie
- run: poetry run ruff format --check
working-directory: python/example-pytest-selfie
Empty file.
602 changes: 602 additions & 0 deletions python/example-pytest-selfie/poetry.lock

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions python/example-pytest-selfie/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[tool.poetry]
name = "example-pytest-selfie"
version = "0.1.0"
description = "An example project for using the pytest plugin for selfie snapshot testing."
authors = ["Selina Delgado <[email protected]>","Harvir Sahota <[email protected]>","Ned Twigg <[email protected]>","Edwin Ye <[email protected]>"]
license = "Apache-2.0"

[tool.poetry.dependencies]
python = "^3.12"
openai = "^1.0.0"

[tool.poetry.group.dev.dependencies]
ruff = "^0.3.0"
pyright = "^1.1.350"
pytest = "^8.0.0"
selfie-lib = { path = "../selfie-lib", develop = true }
pytest-selfie = { path = "../pytest-selfie", develop = true }

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
6 changes: 6 additions & 0 deletions python/example-pytest-selfie/tests/Simple_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from selfie_lib.ArrayMap import ArrayMap


def test_simple():
test = ArrayMap.empty().plus("key", "value")
assert test.__len__() == 1
Empty file.
65 changes: 65 additions & 0 deletions python/pytest-selfie/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
=============
pytest-selfie
=============

.. image:: https://img.shields.io/pypi/v/pytest-selfie.svg
:target: https://pypi.org/project/pytest-selfie
:alt: PyPI version

.. image:: https://img.shields.io/pypi/pyversions/pytest-selfie.svg
:target: https://pypi.org/project/pytest-selfie
:alt: Python versions

.. image:: https://github.com/nedtwigg/pytest-selfie/actions/workflows/main.yml/badge.svg
:target: https://github.com/nedtwigg/pytest-selfie/actions/workflows/main.yml
:alt: See Build Status on GitHub Actions

A pytest plugin for selfie snapshot testing.

---

This `pytest`_ plugin was generated with `Cookiecutter`_ along with `@hackebrot`_'s `cookiecutter-pytest-plugin`_ template.

## Features

- TODO

## Requirements

- TODO

## Installation

You can install "pytest-selfie" via `pip`_ from `PyPI`_::

$ pip install pytest-selfie

## Usage

- TODO

## Contributing

Contributions are very welcome. Tests can be run with `tox`\_, please ensure
the coverage at least stays the same before you submit a pull request.

## License

Distributed under the terms of the `Apache Software License 2.0`\_ license, "pytest-selfie" is free and open source software

## Issues

If you encounter any problems, please `file an issue`\_ along with a detailed description.

.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter
.. _`@hackebrot`: https://github.com/hackebrot
.. _`MIT`: https://opensource.org/licenses/MIT
.. _`BSD-3`: https://opensource.org/licenses/BSD-3-Clause
.. _`GNU GPL v3.0`: https://www.gnu.org/licenses/gpl-3.0.txt
.. _`Apache Software License 2.0`: https://www.apache.org/licenses/LICENSE-2.0
.. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin
.. _`file an issue`: https://github.com/nedtwigg/pytest-selfie/issues
.. _`pytest`: https://github.com/pytest-dev/pytest
.. _`tox`: https://tox.readthedocs.io/en/latest/
.. _`pip`: https://pypi.org/project/pip/
.. _`PyPI`: https://pypi.org/project
3 changes: 3 additions & 0 deletions python/pytest-selfie/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Welcome to pytest-selfie

A pytest plugin for selfie snapshot testing.
10 changes: 10 additions & 0 deletions python/pytest-selfie/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
site_name: pytest-selfie
site_description: A pytest plugin for selfie snapshot testing.
site_author: Ned Twigg

theme: readthedocs

repo_url: https://github.com/nedtwigg/pytest-selfie

pages:
- Home: index.md
Loading

0 comments on commit 635f1df

Please sign in to comment.