narrativetrace-pytest 0.2.0__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (17) hide show
  1. {narrativetrace_pytest-0.2.0 → narrativetrace_pytest-0.3.0}/LICENSE +2 -2
  2. {narrativetrace_pytest-0.2.0 → narrativetrace_pytest-0.3.0}/PKG-INFO +1 -1
  3. {narrativetrace_pytest-0.2.0 → narrativetrace_pytest-0.3.0}/pyproject.toml +1 -1
  4. {narrativetrace_pytest-0.2.0 → narrativetrace_pytest-0.3.0}/src/narrativetrace_pytest/__init__.py +1 -1
  5. narrativetrace_pytest-0.3.0/tests/fixture_wiring.py +26 -0
  6. narrativetrace_pytest-0.3.0/tests/test_fixture_wiring.py +28 -0
  7. {narrativetrace_pytest-0.2.0 → narrativetrace_pytest-0.3.0}/.gitignore +0 -0
  8. {narrativetrace_pytest-0.2.0 → narrativetrace_pytest-0.3.0}/README.md +0 -0
  9. {narrativetrace_pytest-0.2.0 → narrativetrace_pytest-0.3.0}/src/narrativetrace_pytest/plugin.py +0 -0
  10. {narrativetrace_pytest-0.2.0 → narrativetrace_pytest-0.3.0}/src/narrativetrace_pytest/py.typed +0 -0
  11. {narrativetrace_pytest-0.2.0 → narrativetrace_pytest-0.3.0}/tests/_subprocess_coverage/sitecustomize.py +0 -0
  12. {narrativetrace_pytest-0.2.0 → narrativetrace_pytest-0.3.0}/tests/conftest.py +0 -0
  13. {narrativetrace_pytest-0.2.0 → narrativetrace_pytest-0.3.0}/tests/test_conformance.py +0 -0
  14. {narrativetrace_pytest-0.2.0 → narrativetrace_pytest-0.3.0}/tests/test_doctor_truthy_parity.py +0 -0
  15. {narrativetrace_pytest-0.2.0 → narrativetrace_pytest-0.3.0}/tests/test_plugin.py +0 -0
  16. {narrativetrace_pytest-0.2.0 → narrativetrace_pytest-0.3.0}/tests/test_run_name_byte_identity.py +0 -0
  17. {narrativetrace_pytest-0.2.0 → narrativetrace_pytest-0.3.0}/tests/test_structural_plugin.py +0 -0
@@ -7,7 +7,7 @@ Parameters
7
7
 
8
8
  Licensor: Empower Agile
9
9
 
10
- Licensed Work: NarrativeTrace for Python (the narrativetrace PyPI distributions) version 0.2.0. The Licensed Work is (c) 2026 Empower Agile.
10
+ Licensed Work: NarrativeTrace for Python (the narrativetrace PyPI distributions) version 0.3.0. The Licensed Work is (c) 2026 Empower Agile.
11
11
 
12
12
  Additional Use Grant: You may make production use of the Licensed Work for any
13
13
  purpose, including internal use and use in products and
@@ -18,7 +18,7 @@ Additional Use Grant: You may make production use of the Licensed Work for any
18
18
  parties as a logging, tracing, or code-narrative product
19
19
  or service.
20
20
 
21
- Change Date: Four years from the date the Licensed Work is published. (2030-10-05 for this version)
21
+ Change Date: Four years from the date the Licensed Work is published. (2030-10-10 for this version)
22
22
 
23
23
  Change License: Apache License, Version 2.0
24
24
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: narrativetrace-pytest
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: pytest plugin for narrativetrace: per-test trace fixtures, artifacts, and reporting
5
5
  Project-URL: Homepage, https://github.com/narrativetrace/narrativetrace-python
6
6
  Project-URL: Source, https://github.com/narrativetrace/narrativetrace-python
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "narrativetrace-pytest"
3
- version = "0.2.0"
3
+ version = "0.3.0"
4
4
  description = "pytest plugin for narrativetrace: per-test trace fixtures, artifacts, and reporting"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -4,4 +4,4 @@
4
4
  # Copyright (c) 2026 Empower Agile
5
5
  """pytest plugin for narrativetrace."""
6
6
 
7
- __version__ = "0.2.0"
7
+ __version__ = "0.3.0"
@@ -0,0 +1,26 @@
1
+ # SPDX-License-Identifier: BUSL-1.1
2
+ # Licensed under the Business Source License 1.1 (see LICENSE); Change Date: four
3
+ # years from publication; Change License: Apache-2.0
4
+ # Copyright (c) 2026 Empower Agile
5
+ """The pytest row's wiring, as the framework table shows it: a test that requests the
6
+ ``narrative_trace`` fixture and traces through it. Not collected here (the outer session disables
7
+ the plugin); ``test_fixture_wiring.py`` runs it under the real plugin. The doctor's
8
+ ``config.pytest-fixture`` fix and ``llms-full.md`` carry the ``wiring`` region verbatim
9
+ (``narrativetrace_tooling/frameworks/wiring-snippets.md``)."""
10
+
11
+ from __future__ import annotations
12
+
13
+ # snippet:begin wiring
14
+ from narrativetrace import ContextVarNarrativeContext, trace_object
15
+
16
+
17
+ def test_place_order(narrative_trace: ContextVarNarrativeContext) -> None:
18
+ service = trace_object(OrderService(), narrative_trace)
19
+
20
+ assert service.place_order("cust-1", "prod-42") == "ORD-cust-1-prod-42"
21
+ # snippet:end wiring
22
+
23
+
24
+ class OrderService:
25
+ def place_order(self, customer_id: str, product_id: str) -> str:
26
+ return f"ORD-{customer_id}-{product_id}"
@@ -0,0 +1,28 @@
1
+ # SPDX-License-Identifier: BUSL-1.1
2
+ # Licensed under the Business Source License 1.1 (see LICENSE); Change Date: four
3
+ # years from publication; Change License: Apache-2.0
4
+ # Copyright (c) 2026 Empower Agile
5
+ """The pytest row's wiring fixture works as printed: run under the real plugin, its test passes and
6
+ the plugin writes that test's trace."""
7
+
8
+ from __future__ import annotations
9
+
10
+ from pathlib import Path
11
+
12
+ import pytest
13
+
14
+ _FIXTURE = Path(__file__).with_name("fixture_wiring.py")
15
+
16
+
17
+ def test_the_wired_test_passes_and_writes_its_trace(
18
+ pytester: pytest.Pytester, monkeypatch: pytest.MonkeyPatch
19
+ ) -> None:
20
+ out_dir = pytester.path / "nt-out"
21
+ monkeypatch.setenv("NARRATIVETRACE_OUTPUT_DIR", str(out_dir))
22
+ pytester.makepyfile(test_wired=_FIXTURE.read_text(encoding="utf-8"))
23
+
24
+ result = pytester.runpytest_subprocess()
25
+
26
+ result.assert_outcomes(passed=1)
27
+ traces = [path.read_text(encoding="utf-8") for path in out_dir.rglob("*.md")]
28
+ assert any("OrderService.place_order" in text for text in traces)