From 2d8f40091933878ef4ef7c7e316312e413a852a0 Mon Sep 17 00:00:00 2001 From: fomalhaut Date: Tue, 23 Jan 2024 16:55:20 +0900 Subject: [PATCH 01/12] fix: warnings detected by [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint). --- README.md | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index fc5f2de..13808d3 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,28 @@ -# pytest-sqlalchemy-mock 👋 +# pytest-sqlalchemy-mock + [![PyPI version](https://badge.fury.io/py/pytest-sqlalchemy-mock.svg)](https://badge.fury.io/py/pytest-sqlalchemy-mock) [![codecov](https://codecov.io/gh/resulyrt93/pytest-sqlalchemy-mock/branch/dev/graph/badge.svg?token=RUQ4DN3CH9)](https://codecov.io/gh/resulyrt93/pytest-sqlalchemy-mock) [![CI](https://github.com/resulyrt93/pytest-sqlalchemy-mock/actions/workflows/tests.yaml/badge.svg?branch=dev)](https://github.com/resulyrt93/pytest-sqlalchemy-mock/actions/workflows/tests.yaml) -[![Supported Python Version](https://img.shields.io/pypi/pyversions/pytest-sqlalchemy-mock)](https://github.com/resulyrt93/pytest-sqlalchemy-mock) Code style: black This plugin provides pytest fixtures to create an in-memory DB instance on tests and dump your raw test data. +## Supported Python versions + +Python 3.12 or later highly recommended but also might work on Python 3.11. + ## Installation -``` + +```python pip install pytest-sqlalchemy-mock ``` ## Usage + Let's assume you have a SQLAlchemy declarative base and some models with it. -**models.py** +### models.py + ```python from sqlalchemy import Column, Integer, String from sqlalchemy.orm import declarative_base @@ -29,25 +36,31 @@ class User(Base): id = Column(Integer, primary_key=True) name = Column(String) ``` + Firstly SQLAlchemy base class which is used for declare models should be passed with `sqlalchemy_declarative_base` fixture in `conftest.py` -**conftest.py** +### conftest.py + ```python @pytest.fixture(scope="function") def sqlalchemy_declarative_base(): return Base ``` + Then in test functions you can use `mocked_session` fixture to make query in mocked DB. -**test_user_table.py** +### test_user_table.py + ```python def test_mocked_session_user_table(mocked_session): user_data = mocked_session.execute("SELECT * from user;").all() assert user_data == [] ``` + Also, you can dump your mock data to DB before start testing via `sqlalchemy_mock_config` fixture like following. -**conftest.py** +### conftest.py + ```python @pytest.fixture(scope="function") def sqlalchemy_mock_config(): @@ -62,7 +75,9 @@ def sqlalchemy_mock_config(): } ])] ``` -**test_user_table.py** + +### test_user_table.py + ```python def test_mocked_session_user_class(mocked_session): user = mocked_session.query(User).filter_by(id=2).first() @@ -70,6 +85,7 @@ def test_mocked_session_user_class(mocked_session): ``` ## Upcoming Features + * Mock with decorator for specific DB states for specific cases. * Support to load data from `.json` and `.csv` * Async SQLAlchemy support From b3d3658bbbe63d3399f41c1dbc28277fdd1a805b Mon Sep 17 00:00:00 2001 From: fomalhaut Date: Tue, 23 Jan 2024 17:14:08 +0900 Subject: [PATCH 02/12] add: `black` formatter. drop: pyupgrade. --- .pre-commit-config.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 55400ec..1974eb1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,22 +4,22 @@ # pre-commit install-hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v4.5.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer exclude: '.*\.pth$' - id: debug-statements - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort - repo: https://github.com/PyCQA/flake8 - rev: 4.0.1 + rev: 7.0.0 hooks: - id: flake8 - - repo: https://github.com/asottile/pyupgrade - rev: v2.32.1 + - repo: https://github.com/psf/black + rev: 23.12.1 hooks: - - id: pyupgrade - args: [ --py36-plus ] + - id: black + language_version: python3.12 \ No newline at end of file From 52f30f2eb8d226541197145ce39a23ec60490023 Mon Sep 17 00:00:00 2001 From: fomalhaut Date: Tue, 23 Jan 2024 19:37:57 +0900 Subject: [PATCH 03/12] change: the directory structure to "src layout". To get more datail, please see [Python Packaging User Guide](https://packaging.python.org/en/latest/overview/). --- .github/workflows/tests.yaml | 8 +-- README.md | 23 +++++++ pyproject.toml | 67 +++++++++++++++++++ requirements-dev.txt | 5 -- setup.cfg | 15 ----- setup.py | 35 ---------- .../pytest_sqlalchemy_mock}/__init__.py | 0 .../pytest_sqlalchemy_mock}/base.py | 0 .../pytest_sqlalchemy_mock}/model_mocker.py | 0 9 files changed, 94 insertions(+), 59 deletions(-) create mode 100644 pyproject.toml delete mode 100644 requirements-dev.txt delete mode 100644 setup.cfg delete mode 100644 setup.py rename {pytest_sqlalchemy_mock => src/pytest_sqlalchemy_mock}/__init__.py (100%) rename {pytest_sqlalchemy_mock => src/pytest_sqlalchemy_mock}/base.py (100%) rename {pytest_sqlalchemy_mock => src/pytest_sqlalchemy_mock}/model_mocker.py (100%) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 13f6d3b..226a600 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.8", "3.9", "3.10" ] + python-version: [ "3.11", "3.12" ] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -21,16 +21,16 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: 'pip' - cache-dependency-path: '**/requirements-dev.txt' + cache-dependency-path: '**/pyproject.toml' - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements-dev.txt + pip install ".[dev]" && pip uninstall -y pytest-sqlalchemy-mock - name: Run pre commit hooks run: | pre-commit run --all-files --show-diff-on-failure - name: Test with pytest run: | - pytest --cov pytest_sqlalchemy_mock --cov-report=term-missing + pytest --cov pytest_sqlalchemy_mock --cov-report=term-missing tests/ - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 diff --git a/README.md b/README.md index 13808d3..6aa1848 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,33 @@ Python 3.12 or later highly recommended but also might work on Python 3.11. ## Installation +### Download from PyPI + ```python pip install pytest-sqlalchemy-mock ``` +### Building from source + +At the top direcotry, + +```sh +python3 -m build +python3 -m pip install dist/pytest_sqlalchemy_mock-*.whl +``` + +or + +```sh +python3 -m pip install . +``` + +## Uninstall + +```sh +python3 -m pip uninstall pytest_sqlalchemy_mock +``` + ## Usage Let's assume you have a SQLAlchemy declarative base and some models with it. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8c9ad16 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,67 @@ +[build-system] +requires = ["setuptools>=69.0.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "pytest-sqlalchemy-mock" +version = "0.1.6" +license.file = "LICENSE" +description = "pytest sqlalchemy plugin for mock" +authors = [ + { name="Resul Yurttakalan", email="resulyrt93@gmail.com" }, +] +requires-python = ">=3.12" +readme = "README.md" +classifiers = [ + "Framework :: Pytest", + "Development Status :: 3 - Alpha", + "Topic :: Software Development :: Testing", + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "License :: OSI Approved :: MIT License", +] + +dependencies = [ + "pytest>=7.0.0", + "sqlalchemy>=2.0.6", +] + +[project.optional-dependencies] +dev = [ + "black>=23.12.1", + "build>=1.0.3", + "flake8>=7.0.0", + "isort>=5.13.2", + "pre-commit>=3.6.0", + "pytest-cov>=4.1.0", +] + +[project.urls] +Homepage = "https://github.com/resulyrt93/pytest-sqlalchemy-mock" + +[tool.black] +target-version = ["py312"] +line-length = 120 + +[tool.isort] +force_grid_wrap = 2 +profile = "black" +py_version = 312 +src_paths = ["src"] + +[tool.pytest.ini_options] +pythonpath = [ + "src", +] + +[tool.pytest] +norecursedirs = [ + "dist", + "build", + ".git", + ".tox", + ".eggs", + "venv", +] diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 51432d5..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,5 +0,0 @@ -sqlalchemy==2.0.6 -flake8 -pytest -pytest-cov -pre-commit diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 14d8ec2..0000000 --- a/setup.cfg +++ /dev/null @@ -1,15 +0,0 @@ -[tool:pytest] -# This section sets configuration for all invocations of py.test, -# both standalone cmdline and running via setup.py -norecursedirs = - .git - *.egg - build - dist - -[bdist_wheel] -universal = 1 - -[flake8] -exclude = - tests/conftest.py diff --git a/setup.py b/setup.py deleted file mode 100644 index 86118d9..0000000 --- a/setup.py +++ /dev/null @@ -1,35 +0,0 @@ -import os - -from setuptools import setup - - -def read(fname): - return open(os.path.join(os.path.dirname(__file__), fname)).read() - - -setup( - name="pytest-sqlalchemy-mock", - license="MIT", - description="pytest sqlalchemy plugin for mock", - long_description=read("README.md"), - long_description_content_type="text/markdown", - version="0.1.5", - author="Resul Yurttakalan", - author_email="resulyrt93@gmail.com", - url="https://github.com/resulyrt93/pytest-sqlalchemy-mock", - packages=["pytest_sqlalchemy_mock"], - entry_points={ - "pytest11": ["pytest_sqlalchemy_mock = pytest_sqlalchemy_mock.base"] - }, - install_requires=["pytest>=2.0", "sqlalchemy"], - classifiers=[ - "Framework :: Pytest", - "Development Status :: 3 - Alpha", - "Topic :: Software Development :: Testing", - "Intended Audience :: Developers", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - ], -) diff --git a/pytest_sqlalchemy_mock/__init__.py b/src/pytest_sqlalchemy_mock/__init__.py similarity index 100% rename from pytest_sqlalchemy_mock/__init__.py rename to src/pytest_sqlalchemy_mock/__init__.py diff --git a/pytest_sqlalchemy_mock/base.py b/src/pytest_sqlalchemy_mock/base.py similarity index 100% rename from pytest_sqlalchemy_mock/base.py rename to src/pytest_sqlalchemy_mock/base.py diff --git a/pytest_sqlalchemy_mock/model_mocker.py b/src/pytest_sqlalchemy_mock/model_mocker.py similarity index 100% rename from pytest_sqlalchemy_mock/model_mocker.py rename to src/pytest_sqlalchemy_mock/model_mocker.py From 312ee5dc4318cbb5c64a39711fa4662dd574c4c7 Mon Sep 17 00:00:00 2001 From: fomalhaut Date: Thu, 25 Jan 2024 20:54:11 +0900 Subject: [PATCH 04/12] update: `actions/checkout` and `actions/setup-python`. --- .github/workflows/tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 226a600..bc3c3c2 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -15,9 +15,9 @@ jobs: matrix: python-version: [ "3.11", "3.12" ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: 'pip' From 7924a5dcbdee16fff4cd07caa99004d425de69bd Mon Sep 17 00:00:00 2001 From: fomalhaut Date: Thu, 25 Jan 2024 21:01:22 +0900 Subject: [PATCH 05/12] add: "feature/**" branches to GitHub actions. --- .github/workflows/tests.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index bc3c3c2..fbc63ba 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -4,6 +4,7 @@ on: push: branches: - dev + - 'feature/**' pull_request: branches: - dev From 02fd57cfc3ef34fa3d62a4e001d5bed50f0c913c Mon Sep 17 00:00:00 2001 From: fomalhaut Date: Thu, 25 Jan 2024 21:07:56 +0900 Subject: [PATCH 06/12] detailed up: logs of pytest. --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index fbc63ba..3c7e13d 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -32,6 +32,6 @@ jobs: pre-commit run --all-files --show-diff-on-failure - name: Test with pytest run: | - pytest --cov pytest_sqlalchemy_mock --cov-report=term-missing tests/ + pytest --cov pytest_sqlalchemy_mock --cov-report=term-missing -s -vv tests/ - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 From 30284770775909966b1e43601f239e70cb12e827 Mon Sep 17 00:00:00 2001 From: fomalhaut Date: Thu, 25 Jan 2024 21:36:19 +0900 Subject: [PATCH 07/12] fix: no newline. --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1974eb1..bb4b557 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,4 +22,4 @@ repos: rev: 23.12.1 hooks: - id: black - language_version: python3.12 \ No newline at end of file + language_version: python3.12 From 2dd62c1ea52240da5429c76365ff4884b9d1f2f7 Mon Sep 17 00:00:00 2001 From: fomalhaut Date: Thu, 25 Jan 2024 21:37:32 +0900 Subject: [PATCH 08/12] add: config file of `flake8`. --- .flake8 | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..1b819ca --- /dev/null +++ b/.flake8 @@ -0,0 +1,8 @@ +[flake8] +exclude = + .git, + .github, + .venv, + build, + dist, + tests/conftest.py From b0519d140f30cc2d2f4fe9a5be7ca5452fffb44d Mon Sep 17 00:00:00 2001 From: fomalhaut Date: Thu, 25 Jan 2024 22:22:51 +0900 Subject: [PATCH 09/12] fit to lints. --- pyproject.toml | 1 + src/pytest_sqlalchemy_mock/base.py | 8 ++------ src/pytest_sqlalchemy_mock/model_mocker.py | 5 ++++- tests/db.py | 21 +++++++++++++++------ tests/test_pytest_sqlalchemy_mock.py | 10 +++++----- 5 files changed, 27 insertions(+), 18 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8c9ad16..a388bed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,6 +50,7 @@ force_grid_wrap = 2 profile = "black" py_version = 312 src_paths = ["src"] +skip_glob = ["tests/conftest.py", "build/*", "dist/*",] [tool.pytest.ini_options] pythonpath = [ diff --git a/src/pytest_sqlalchemy_mock/base.py b/src/pytest_sqlalchemy_mock/base.py index d684e23..7fc0ce7 100644 --- a/src/pytest_sqlalchemy_mock/base.py +++ b/src/pytest_sqlalchemy_mock/base.py @@ -45,15 +45,11 @@ def session(connection): @pytest.fixture(scope="function") -def mocked_session( - connection, sqlalchemy_declarative_base, sqlalchemy_mock_config -): +def mocked_session(connection, sqlalchemy_declarative_base, sqlalchemy_mock_config): session: Session = sessionmaker()(bind=connection) if sqlalchemy_declarative_base and sqlalchemy_mock_config: - ModelMocker( - session, sqlalchemy_declarative_base, sqlalchemy_mock_config - ).create_all() + ModelMocker(session, sqlalchemy_declarative_base, sqlalchemy_mock_config).create_all() yield session session.close() diff --git a/src/pytest_sqlalchemy_mock/model_mocker.py b/src/pytest_sqlalchemy_mock/model_mocker.py index 097d2f8..5ac1ca4 100644 --- a/src/pytest_sqlalchemy_mock/model_mocker.py +++ b/src/pytest_sqlalchemy_mock/model_mocker.py @@ -3,7 +3,10 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing import List, Tuple + from typing import ( + List, + Tuple, + ) from sqlalchemy import Table from sqlalchemy.orm import Session diff --git a/tests/db.py b/tests/db.py index f84544e..d8bb646 100644 --- a/tests/db.py +++ b/tests/db.py @@ -1,8 +1,19 @@ from typing import List -from sqlalchemy import (Boolean, Column, DateTime, ForeignKey, Integer, String, - func) -from sqlalchemy.orm import Mapped, declarative_base, relationship +from sqlalchemy import ( + Boolean, + Column, + DateTime, + ForeignKey, + Integer, + String, + func, +) +from sqlalchemy.orm import ( + Mapped, + declarative_base, + relationship, +) from sqlalchemy.testing.schema import Table Base = declarative_base() @@ -12,9 +23,7 @@ "user_department", Base.metadata, Column("user_id", Integer, ForeignKey("user.id"), primary_key=True), - Column( - "department_id", Integer, ForeignKey("department.id"), primary_key=True - ), + Column("department_id", Integer, ForeignKey("department.id"), primary_key=True), ) diff --git a/tests/test_pytest_sqlalchemy_mock.py b/tests/test_pytest_sqlalchemy_mock.py index 8992fe8..154d816 100644 --- a/tests/test_pytest_sqlalchemy_mock.py +++ b/tests/test_pytest_sqlalchemy_mock.py @@ -1,7 +1,10 @@ from sqlalchemy import text from .data import MockData -from .db import Department, User +from .db import ( + Department, + User, +) def test_get_session(session): @@ -13,10 +16,7 @@ def test_session_user_table(session): def test_session_query_for_assocation_table(session): - assert ( - session.execute(text("SELECT count(*) from user_department")).scalar() - == 0 - ) + assert session.execute(text("SELECT count(*) from user_department")).scalar() == 0 def test_mocked_session_user_table(mocked_session): From 54de8fba527b3f039d9137a9c62f430334a101ee Mon Sep 17 00:00:00 2001 From: fomalhaut Date: Thu, 25 Jan 2024 23:08:12 +0900 Subject: [PATCH 10/12] add: Python 3.9 and 3.10 to GitHub actions. --- .flake8 | 1 + .github/workflows/tests.yaml | 2 +- README.md | 1 + pyproject.toml | 4 +++- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.flake8 b/.flake8 index 1b819ca..75fe339 100644 --- a/.flake8 +++ b/.flake8 @@ -1,4 +1,5 @@ [flake8] +max-line-length = 120 exclude = .git, .github, diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 3c7e13d..c709960 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.11", "3.12" ] + python-version: [ "3.9", "3.10", "3.11", "3.12" ] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} diff --git a/README.md b/README.md index 6aa1848..aa0eb96 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![PyPI version](https://badge.fury.io/py/pytest-sqlalchemy-mock.svg)](https://badge.fury.io/py/pytest-sqlalchemy-mock) [![codecov](https://codecov.io/gh/resulyrt93/pytest-sqlalchemy-mock/branch/dev/graph/badge.svg?token=RUQ4DN3CH9)](https://codecov.io/gh/resulyrt93/pytest-sqlalchemy-mock) [![CI](https://github.com/resulyrt93/pytest-sqlalchemy-mock/actions/workflows/tests.yaml/badge.svg?branch=dev)](https://github.com/resulyrt93/pytest-sqlalchemy-mock/actions/workflows/tests.yaml) +[![Supported Python Version](https://img.shields.io/pypi/pyversions/pytest-sqlalchemy-mock)](https://github.com/resulyrt93/pytest-sqlalchemy-mock) Code style: black This plugin provides pytest fixtures to create an in-memory DB instance on tests and dump your raw test data. diff --git a/pyproject.toml b/pyproject.toml index a388bed..1e51c10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ description = "pytest sqlalchemy plugin for mock" authors = [ { name="Resul Yurttakalan", email="resulyrt93@gmail.com" }, ] -requires-python = ">=3.12" +requires-python = ">=3.9" readme = "README.md" classifiers = [ "Framework :: Pytest", @@ -18,6 +18,8 @@ classifiers = [ "Topic :: Software Development :: Testing", "Intended Audience :: Developers", "Operating System :: OS Independent", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "License :: OSI Approved :: MIT License", From 5add52c4c27bd4ec79e5ce43476b44fbb4fcd935 Mon Sep 17 00:00:00 2001 From: fomalhaut Date: Thu, 25 Jan 2024 23:49:04 +0900 Subject: [PATCH 11/12] fix: failed jobs on GitHub actions. --- .github/workflows/tests.yaml | 5 ++--- .pre-commit-config.yaml | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index c709960..0304121 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -21,12 +21,11 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - cache: 'pip' - cache-dependency-path: '**/pyproject.toml' - name: Install dependencies run: | python -m pip install --upgrade pip - pip install ".[dev]" && pip uninstall -y pytest-sqlalchemy-mock + pip install --no-cache-dir ".[dev]" + pip uninstall -y pytest-sqlalchemy-mock - name: Run pre commit hooks run: | pre-commit run --all-files --show-diff-on-failure diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bb4b557..7df6773 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,4 +22,3 @@ repos: rev: 23.12.1 hooks: - id: black - language_version: python3.12 From 4971fe2177174b11d2eb2107b87b27f56427550c Mon Sep 17 00:00:00 2001 From: Carmen Alvarez Date: Sat, 20 Jul 2024 16:24:03 +0200 Subject: [PATCH 12/12] fix: Update `pyproject.toml` to include the fixtures as a pytest plugin. Addresses issue #12. --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1e51c10..2a3c716 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pytest-sqlalchemy-mock" -version = "0.1.6" +version = "0.1.7" license.file = "LICENSE" description = "pytest sqlalchemy plugin for mock" authors = [ @@ -68,3 +68,6 @@ norecursedirs = [ ".eggs", "venv", ] + +[project.entry-points."pytest11"] +pytest_sqlalchemy_mock = "pytest_sqlalchemy_mock.base"