Skip to content

Commit 635f1df

Browse files
authored
Add a skeleton of the pytest plugin (#49)
2 parents eb3e99c + fc452ca commit 635f1df

File tree

17 files changed

+1171
-4
lines changed

17 files changed

+1171
-4
lines changed

.github/workflows/python-ci.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ on:
44
pull_request:
55
paths:
66
- "python/**"
7-
defaults:
8-
run:
9-
working-directory: python/selfie-lib
107
concurrency:
118
group: ${{ github.workflow }}-${{ github.ref }}
129
cancel-in-progress: true
@@ -27,6 +24,28 @@ jobs:
2724
python-version-file: "python/selfie-lib/pyproject.toml"
2825
cache: "poetry"
2926
- run: poetry install
27+
working-directory: python/selfie-lib
3028
- run: poetry run pytest -vv
29+
working-directory: python/selfie-lib
3130
- run: poetry run pyright
31+
working-directory: python/selfie-lib
3232
- run: poetry run ruff format --check
33+
working-directory: python/selfie-lib
34+
- run: poetry install
35+
working-directory: python/pytest-selfie
36+
- run: poetry run pytest -vv
37+
working-directory: python/pytest-selfie
38+
- run: poetry run tox -e py
39+
working-directory: python/pytest-selfie
40+
- run: poetry run pyright
41+
working-directory: python/pytest-selfie
42+
- run: poetry run ruff format --check
43+
working-directory: python/pytest-selfie
44+
- run: poetry install
45+
working-directory: python/example-pytest-selfie
46+
- run: poetry run pytest -vv
47+
working-directory: python/example-pytest-selfie
48+
- run: poetry run pyright
49+
working-directory: python/example-pytest-selfie
50+
- run: poetry run ruff format --check
51+
working-directory: python/example-pytest-selfie

python/example-pytest-selfie/example_pytest_selfie/__init__.py

Whitespace-only changes.

python/example-pytest-selfie/poetry.lock

Lines changed: 602 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[tool.poetry]
2+
name = "example-pytest-selfie"
3+
version = "0.1.0"
4+
description = "An example project for using the pytest plugin for selfie snapshot testing."
5+
authors = ["Selina Delgado <sdelgado411@gmail.com>","Harvir Sahota <hsahota2312@gmail.com>","Ned Twigg <ned.twigg@diffplug.com>","Edwin Ye <EdwinYeDeveloper@gmail.com>"]
6+
license = "Apache-2.0"
7+
8+
[tool.poetry.dependencies]
9+
python = "^3.12"
10+
openai = "^1.0.0"
11+
12+
[tool.poetry.group.dev.dependencies]
13+
ruff = "^0.3.0"
14+
pyright = "^1.1.350"
15+
pytest = "^8.0.0"
16+
selfie-lib = { path = "../selfie-lib", develop = true }
17+
pytest-selfie = { path = "../pytest-selfie", develop = true }
18+
19+
[build-system]
20+
requires = ["poetry-core"]
21+
build-backend = "poetry.core.masonry.api"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from selfie_lib.ArrayMap import ArrayMap
2+
3+
4+
def test_simple():
5+
test = ArrayMap.empty().plus("key", "value")
6+
assert test.__len__() == 1

python/example-pytest-selfie/tests/__init__.py

Whitespace-only changes.

python/pytest-selfie/README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
=============
2+
pytest-selfie
3+
=============
4+
5+
.. image:: https://img.shields.io/pypi/v/pytest-selfie.svg
6+
:target: https://pypi.org/project/pytest-selfie
7+
:alt: PyPI version
8+
9+
.. image:: https://img.shields.io/pypi/pyversions/pytest-selfie.svg
10+
:target: https://pypi.org/project/pytest-selfie
11+
:alt: Python versions
12+
13+
.. image:: https://github.com/nedtwigg/pytest-selfie/actions/workflows/main.yml/badge.svg
14+
:target: https://github.com/nedtwigg/pytest-selfie/actions/workflows/main.yml
15+
:alt: See Build Status on GitHub Actions
16+
17+
A pytest plugin for selfie snapshot testing.
18+
19+
---
20+
21+
This `pytest`_ plugin was generated with `Cookiecutter`_ along with `@hackebrot`_'s `cookiecutter-pytest-plugin`_ template.
22+
23+
## Features
24+
25+
- TODO
26+
27+
## Requirements
28+
29+
- TODO
30+
31+
## Installation
32+
33+
You can install "pytest-selfie" via `pip`_ from `PyPI`_::
34+
35+
$ pip install pytest-selfie
36+
37+
## Usage
38+
39+
- TODO
40+
41+
## Contributing
42+
43+
Contributions are very welcome. Tests can be run with `tox`\_, please ensure
44+
the coverage at least stays the same before you submit a pull request.
45+
46+
## License
47+
48+
Distributed under the terms of the `Apache Software License 2.0`\_ license, "pytest-selfie" is free and open source software
49+
50+
## Issues
51+
52+
If you encounter any problems, please `file an issue`\_ along with a detailed description.
53+
54+
.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter
55+
.. _`@hackebrot`: https://github.com/hackebrot
56+
.. _`MIT`: https://opensource.org/licenses/MIT
57+
.. _`BSD-3`: https://opensource.org/licenses/BSD-3-Clause
58+
.. _`GNU GPL v3.0`: https://www.gnu.org/licenses/gpl-3.0.txt
59+
.. _`Apache Software License 2.0`: https://www.apache.org/licenses/LICENSE-2.0
60+
.. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin
61+
.. _`file an issue`: https://github.com/nedtwigg/pytest-selfie/issues
62+
.. _`pytest`: https://github.com/pytest-dev/pytest
63+
.. _`tox`: https://tox.readthedocs.io/en/latest/
64+
.. _`pip`: https://pypi.org/project/pip/
65+
.. _`PyPI`: https://pypi.org/project

python/pytest-selfie/docs/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Welcome to pytest-selfie
2+
3+
A pytest plugin for selfie snapshot testing.

python/pytest-selfie/mkdocs.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
site_name: pytest-selfie
2+
site_description: A pytest plugin for selfie snapshot testing.
3+
site_author: Ned Twigg
4+
5+
theme: readthedocs
6+
7+
repo_url: https://github.com/nedtwigg/pytest-selfie
8+
9+
pages:
10+
- Home: index.md

0 commit comments

Comments
 (0)