From 3932676093bbdd64bfb43163442148239b40f7cc Mon Sep 17 00:00:00 2001 From: Victorien <65306057+Viicos@users.noreply.github.com> Date: Wed, 20 Nov 2024 18:21:28 +0100 Subject: [PATCH 1/2] Allow matching prefix with curly braces in `CodeExample.prefix_settings()` (#44) The SuperFences markdown extensions uses the following format for attributes: `lang-name {.extra-class attr="a"}` See: https://facelessuser.github.io/pymdown-extensions/extensions/superfences/#injecting-classes-ids-and-attributes --- pytest_examples/find_examples.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest_examples/find_examples.py b/pytest_examples/find_examples.py index 9f6523f..123bb8d 100644 --- a/pytest_examples/find_examples.py +++ b/pytest_examples/find_examples.py @@ -76,7 +76,7 @@ def prefix_settings(self) -> dict[str, str]: This works on the format `py foo="bar" spam="with space"`. """ settings = {} - for m in re.finditer(r'(\S+?)=([\'"])(.+?)\2', self.prefix): + for m in re.finditer(r'([^{\s]+?)=([\'"])(.+?)\2', self.prefix): settings[m.group(1)] = m.group(3) return settings From 9a18f65884f4eff17b64b03b168695790a5cb604 Mon Sep 17 00:00:00 2001 From: Sydney Runkle <54324534+sydney-runkle@users.noreply.github.com> Date: Wed, 20 Nov 2024 12:25:35 -0500 Subject: [PATCH 2/2] Bump version to `0.0.15` (#45) --- pyproject.toml | 2 +- uv.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6af632f..11ef2b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ include = ["/README.md", "/Makefile", "/pytest_examples", "/tests"] [project] name = "pytest-examples" -version = "0.0.14" +version = "0.0.15" description = "Pytest plugin for testing examples in docstrings and markdown files." authors = [ {name = "Samuel Colvin", email = "s@muelcolvin.com"}, diff --git a/uv.lock b/uv.lock index 788970b..80b43d2 100644 --- a/uv.lock +++ b/uv.lock @@ -330,7 +330,7 @@ wheels = [ [[package]] name = "pytest-examples" -version = "0.0.14" +version = "0.0.15" source = { editable = "." } dependencies = [ { name = "black" },