Skip to content

Adjust the expected string to match Python 3.11+ changed output #11774

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
wants to merge 1 commit into from

Conversation

befeleme
Copy link
Contributor

@befeleme befeleme commented Nov 28, 2023

Subject: With Python 3.13.0a2 'test_autodoc_default_options' started failing. It's because Python 3.13.0a2 has changed the __doc__ and __weakref__ docstrings, see: python/cpython#112266

Feature or Bugfix

  • future bugfix

@befeleme befeleme marked this pull request as ready for review December 12, 2023 12:55
@befeleme befeleme changed the title Adjust the expected string to match Python 3.13.0a2 changed output Adjust the expected string to match Python 3.11+ changed output Dec 12, 2023
@hroncok
Copy link
Contributor

hroncok commented Dec 12, 2023

Is it necessary to differentiate the asserted contents? What if we ditched the (if defined) part (always)?

@befeleme
Copy link
Contributor Author

Since actual is a list of strings, the change of even a single character in the expected output will result in the false-y assertion. The below could work but its readability is quite worse:

assert any('      list of weak references to the object' in output_part for output_part in actual)

@hroncok
Copy link
Contributor

hroncok commented Dec 12, 2023

Oh, I thought actual is a string and we are checking a substring here. Never mind me then.

@befeleme
Copy link
Contributor Author

...or I could join actual to achieve a single string and use in operator without more hassle.

@hugovk
Copy link
Contributor

hugovk commented Dec 13, 2023

Looks good!

I didn't spot this PR and opened a fairly-similar one this week: #11793

@mitya57
Copy link
Contributor

mitya57 commented Dec 19, 2023

In fact #11793 is better, because in the latest version the condition is improved (0b55aae).

@AA-Turner
Copy link
Member

Closed by #11793.

A

@AA-Turner AA-Turner closed this Dec 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants