Skip to content

test_monitoring contains hardcoded line numbers #115836

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
swtaarrs opened this issue Feb 23, 2024 · 1 comment
Closed

test_monitoring contains hardcoded line numbers #115836

swtaarrs opened this issue Feb 23, 2024 · 1 comment
Assignees
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@swtaarrs
Copy link
Member

swtaarrs commented Feb 23, 2024

Bug report

Bug description:

test_lines_single, test_lines_loop, and test_lines_two in test_monitoring.LinesMonitoringTest all contain some hardcoded line numbers in their expected values. They should consistently use offsets from co_firstlineno on the relevant code objects instead.

I ran into this while adding a test for gh-115832, and already have a fix ready to put up as a PR.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

@swtaarrs swtaarrs added the type-bug An unexpected behavior, bug, or error label Feb 23, 2024
@AlexWaygood AlexWaygood added the tests Tests in the Lib/test dir label Feb 23, 2024
swtaarrs added a commit to swtaarrs/cpython that referenced this issue Feb 23, 2024
Some of the expected line numbers are already offsets from `co_firstlineno`,
but a few more needed to be converted.

- Issue: pythongh-115836
@itamaro
Copy link
Contributor

itamaro commented Feb 23, 2024

Fix merged, closing the issue (please reopen if there's more left to do here).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants