-
Notifications
You must be signed in to change notification settings - Fork 133
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
3.1.1: pyupgrade --py38-plush
generated changes trashes test suite
#449
Labels
Other Improvement
Improvements that aren't targeted at users
Comments
I've tested 3.1.1+ all commits from master ans pytest fails for me in two units Here is pytest output:+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-sphinx-autoapi-3.1.2-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sphinx-autoapi-3.1.2-2.fc37.x86_64/usr/lib/python3.10/site-packages
+ /usr/bin/pytest -ra -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.10.14, pytest-8.2.2, pluggy-1.5.0
rootdir: /home/tkloczko/rpmbuild/BUILD/sphinx-autoapi-3.1.2
configfile: pyproject.toml
collected 312 items
tests/python/test_own_page_option.py ................................... [ 11%]
... [ 12%]
tests/python/test_parser.py .......... [ 15%]
tests/python/test_pyintegration.py .................F...F..s............ [ 27%]
............................... [ 37%]
tests/test_astroid_utils.py ............................................ [ 51%]
........................................................................ [ 74%]
........................................................................ [ 97%]
..... [ 99%]
tests/test_integration.py ... [100%]
=================================== FAILURES ===================================
________________________ TestPy3Module.test_annotations ________________________
self = <test_pyintegration.TestPy3Module object at 0x7f83d5393ee0>
parse = <function parse.<locals>.parser at 0x7f83d23f71c0>
def test_annotations(self, parse):
example_file = parse("_build/html/autoapi/example/index.html")
software = example_file.find(id="example.software")
assert software
software_value = software.find(class_="property").contents[-1]
assert software_value.text.endswith('''"sphin'x"''')
more_software = example_file.find(id="example.more_software")
assert more_software
more_software_value = more_software.find(class_="property").contents[-1]
assert more_software_value.text.endswith("""'sphinx"autoapi'""")
interesting = example_file.find(id="example.interesting_string")
assert interesting
interesting_value = interesting.find(class_="property").contents[-1]
assert interesting_value.text.endswith("'interesting\"fun\\'\\\\\\'string'")
code_snippet = example_file.find(id="example.code_snippet")
assert code_snippet
code_snippet_value = code_snippet.find(class_="property").contents[-1]
assert code_snippet_value.text == "Multiline-String"
max_rating = example_file.find(id="example.max_rating")
assert max_rating
max_rating_value = max_rating.find_all(class_="property")
assert max_rating_value[0].text == ": int"
assert max_rating_value[1].text == " = 10"
# TODO: This should either not have a value
# or should display the value as part of the type declaration.
# This prevents setting warningiserror.
assert example_file.find(id="example.is_valid")
ratings = example_file.find(id="example.ratings")
assert ratings
ratings_value = ratings.find_all(class_="property")
> assert "List[int]" in ratings_value[0].text
E assert 'List[int]' in ': list[int]'
E + where ': list[int]' = <em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">list</..."p"><span class="pre">[</span></span><span class="pre">int</span><span class="p"><span class="pre">]</span></span></em>.text
/home/tkloczko/rpmbuild/BUILD/sphinx-autoapi-3.1.2/tests/python/test_pyintegration.py:312: AssertionError
________________ TestAnnotationCommentsModule.test_integration _________________
self = <test_pyintegration.TestAnnotationCommentsModule object at 0x7f83d5393310>
parse = <function parse.<locals>.parser at 0x7f83d20c5ab0>
def test_integration(self, parse):
example_file = parse("_build/html/autoapi/example/index.html")
max_rating = example_file.find(id="example.max_rating")
assert max_rating
max_rating_value = max_rating.find_all(class_="property")
assert max_rating_value[0].text == ": int"
assert max_rating_value[1].text == " = 10"
ratings = example_file.find(id="example.ratings")
assert ratings
ratings_value = ratings.find_all(class_="property")
assert "List[int]" in ratings_value[0].text
rating_names = example_file.find(id="example.rating_names")
assert rating_names
rating_names_value = rating_names.find_all(class_="property")
assert "Dict[int, str]" in rating_names_value[0].text
f = example_file.find(id="example.f")
assert f
assert f.find(class_="sig-param").text == "start: int"
> assert f.find(class_="sig-return-typehint").text == "Iterable[int]"
E AssertionError: assert 'collections....Iterable[int]' == 'Iterable[int]'
E
E - Iterable[int]
E + collections.abc.Iterable[int]
/home/tkloczko/rpmbuild/BUILD/sphinx-autoapi-3.1.2/tests/python/test_pyintegration.py:472: AssertionError
---------------------------- Captured stdout setup -----------------------------
Running Sphinx v7.3.7
making output directory... done
[AutoAPI] Reading files... [100%] /home/tkloczko/rpmbuild/BUILD/sphinx-autoapi-3.1.2/tests/python/pyannotationcommentsexample/example/example.py
[AutoAPI] Mapping Data... [100%] /home/tkloczko/rpmbuild/BUILD/sphinx-autoapi-3.1.2/tests/python/pyannotationcommentsexample/example/example.py
[AutoAPI] Rendering Data... [100%] example
[autosummary] generating autosummary for: index.rst
building [mo]: targets for 0 po files that are out of date
writing output...
building [html]: targets for 1 source files that are out of date
updating environment: [new config] 3 added, 0 changed, 0 removed
reading sources... [ 33%] autoapi/example/index
reading sources... [ 67%] autoapi/index
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
copying assets... copying static files... done
copying extra files... done
done
writing output... [ 33%] autoapi/example/index
writing output... [ 67%] autoapi/index
writing output... [100%] index
generating indices... genindex py-modindex done
writing additional pages... search done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded.
The HTML pages are in _build/html.
=========================== short test summary info ============================
SKIPPED [1] tests/python/test_pyintegration.py:603: PEP-695 support requires Python >=3.12
FAILED tests/python/test_pyintegration.py::TestPy3Module::test_annotations - ...
FAILED tests/python/test_pyintegration.py::TestAnnotationCommentsModule::test_integration
================== 2 failed, 309 passed, 1 skipped in 28.32s =================== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've been trying to drop python<=3.7 support by filter all code over
pyupgrade --py38-plush
and after that test suite started failingIt would be good to prepare
sphinx-autoapi
code to make it upgradeable using pyupgrade.The text was updated successfully, but these errors were encountered: