Skip to content

test(8-k): say the #1589 fixture keeps the script tag sec.gov adds (#1589) - #1616

Merged
dgunning merged 1 commit into
dgunning:mainfrom
synfonia-llc:fix/1589-fixture-docstring
Oct 18, 2026
Merged

dgunning merged 1 commit into
dgunning:mainfrom
synfonia-llc:fix/1589-fixture-docstring

Conversation

@synfonia-llc

Copy link
Copy Markdown
Contributor

What this changes

The regression test for #1589 now says, in its fixture docstring, that the saved 8-K page keeps the bot-defense <script> tag that www.sec.gov adds to every response, and why the test is unaffected. Documentation only: the fixture, the assertions and the library are unchanged. Follow-up to the review on #1590.

Refs #1589

Verification

  • Ground truth: at least one assertion checks a specific value against a real SEC filing I verified by hand. Filing and accession:
  • Regression test for a bug is in tests/issues/regression/, and its docstring links the issue or bead
  • Cassettes were recorded from live SEC and not edited afterwards (see CONTRIBUTING.md). Recorded on:
  • Silence check: bad or missing input produces a useful error, not None
  • Docs: any documented example this touches still runs
  • Changelog: a changelog.d/<id>.<section>.md fragment, not an edit to CHANGELOG.md

The change clarifies the fixture docstring of the existing #1589 regression test, whose assertions and fixture are untouched. A changelog fragment, changelog.d/1589.changed.md, records that clarification. The other unchecked boxes describe work this PR does not add.

6.0

  • This PR adds a deprecation, a 6.0 warning, or a "removed in 6.0" note, and docs/upgrade/6.0.md says what users see now and what to do instead

CI fails a PR that stages a 6.0 change without touching the upgrade guide. If it flags something that isn't a 6.0 change, add the no-upgrade-guide label, say why here, and re-run the job.

AI assistance

  • None
  • Assisted. Tool and model: Claude Code. Claude Opus 5.5 (extra-high reasoning effort) decided and wrote the docstring change; GPT-6.1 Sol in Codex (ultra reasoning effort) recommended keeping the fixture as served and mentioning the tag, and reviewed the change adversarially, which added the changelog fragment.

Working context (optional)

  • Mention rather than drop. You offered either. Keeping the tag leaves the file exactly what the SEC returned for 8kSYQH.htm (0000710782-24-000005), so the docstring's "byte for byte" stays true and nothing in the fixture is edited by hand.
  • Why the tag does not matter to the test. The fixture has one <script> element, at the end of the body. The test builds its text with HTMLParser(ParserConfig(form="8-K")), whose preprocessor removes script and style elements before parsing (edgar/documents/processors/preprocessor.py:120 and :163-166). The assertions concern the filed item headings and text.
  • Run on this branch: pytest tests/issues/regression/test_issue_1589.py (12 passed), ruff check on the file (clean), and the offline suite pytest -m fast -n auto (42,606 passed, 27 failed). The unchanged base, main at 4f11882, gives the same 42,606 passed and 27 failed on this machine (Windows 11, Python 3.14.4), and the base's 27 failing tests fail the same way on this branch when run on their own, except one that passes alone. They are text-output baselines and other recorded-output checks, none of which reads this docstring or the fragment. The changelog check and the upgrade-guide gate pass on the final commit (tests/meta/test_assemble_changelog.py, tests/meta/test_upgrade_guide_gate.py).

… adds (dgunning#1589)

The fixture docstring said the saved 8-K page is byte for byte what the SEC served,
which is true, but the file also carries the bot-defense script tag www.sec.gov adds
to every response (its src changes per request), which is not part of the filing.
The docstring now says so, and why the test is unaffected: the HTML parser removes
script elements before building the text, and the assertions concern the filed item
headings and text. Docstring only; the fixture and the assertions are unchanged.

Follow-up to the review on dgunning#1590.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dgunning
dgunning merged commit e730509 into dgunning:main Oct 18, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants