This issue was found by a Codex global code scan of the repository.
Affected code:
|
def test_dpmd(self) -> None: |
|
from .dpmdargs import gen_doc |
|
|
|
dargs.RAW_ANCHOR = False |
|
docstr = gen_doc(make_anchor=True, make_link=True) |
|
# print("\n\n"+docstr) |
|
# with open("out.rst", "w") as of: |
|
# print(docstr, file=of) |
|
# now testing raw anchor |
|
dargs.RAW_ANCHOR = True |
|
docstr = gen_doc(make_anchor=True, make_link=True) |
|
# print("\n\n"+docstr) |
|
# with open("outr.rst", "w") as of: |
|
# print(docstr, file=of) |
|
INDENT = " " # doc is indented by four spaces |
|
RAW_ANCHOR = False # whether to use raw html anchors or RST ones |
|
from .dargs import Argument, ArgumentEncoder, Variant |
|
|
|
__all__ = ["Argument", "ArgumentEncoder", "Variant"] |
Problem:
tests/test_docgen.py sets dargs.RAW_ANCHOR = True, but RAW_ANCHOR is defined in dargs.dargs, not exported from dargs.__init__. Assigning to the package creates a new package attribute and leaves the actual global used by make_rst_refid() unchanged.
Reproducer:
import dargs
import dargs.dargs as dd
print(hasattr(dargs, "RAW_ANCHOR"), dd.RAW_ANCHOR)
dargs.RAW_ANCHOR = True
print(dargs.RAW_ANCHOR, dd.RAW_ANCHOR)
Observed behavior:
The package attribute becomes True, but dargs.dargs.RAW_ANCHOR remains False, so the raw-anchor branch is not covered.
Expected behavior:
The test should mutate dargs.dargs.RAW_ANCHOR directly or the package should intentionally export and synchronize that setting.
This issue was found by a Codex global code scan of the repository.
Affected code:
dargs/tests/test_docgen.py
Lines 250 to 263 in b4db564
dargs/dargs/dargs.py
Lines 38 to 39 in b4db564
dargs/dargs/__init__.py
Lines 3 to 5 in b4db564
Problem:
tests/test_docgen.pysetsdargs.RAW_ANCHOR = True, butRAW_ANCHORis defined indargs.dargs, not exported fromdargs.__init__. Assigning to the package creates a new package attribute and leaves the actual global used bymake_rst_refid()unchanged.Reproducer:
Observed behavior:
The package attribute becomes
True, butdargs.dargs.RAW_ANCHORremainsFalse, so the raw-anchor branch is not covered.Expected behavior:
The test should mutate
dargs.dargs.RAW_ANCHORdirectly or the package should intentionally export and synchronize that setting.