test_insert_behavior fails on Python 3.11
See original GitHub issueWhile running the tests with Python 3.11.0rc2, I’m seeing this failure.
FAIL: test_insert_behavior (tests.sqlite.TestSqliteReturningConfig.test_insert_behavior)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/carl/development/peewee/tests/sqlite.py", line 2506, in test_insert_behavior
self.assertEqual(iq.execute(), 2)
AssertionError: 0 != 2
Steps to reproduce on Fedora 36 or 37:
dnf -y install gcc git-core sqlite-devel python3.11-devel
git clone https://github.com/coleifer/peewee.git
cd peewee
python3.11 -m venv py311
. py311/bin/activate
pip install cython
python setup.py install
python setup.py build_ext -i
python runtests.py
EDIT: Forgot to include the exact versions involved. Let me know if others are needed.
F36: python3.11-3.11.0~rc2-1.fc36 sqlite-3.36.0-5.fc36
F37: python3-3.11.0~rc2-1.fc37 sqlite-3.39.2-2.fc37
Issue Analytics
- State:
- Created a year ago
- Comments:19 (16 by maintainers)
Top Results From Across the Web
What's New In Python 3.11 — Python 3.11.1 documentation
This article explains the new features in Python 3.11, compared to 3.10. For full details, see the ... PEP 657: Fine-grained error locations...
Read more >Pip install of wxPython 4.2.0 fails with python 3.11 · Issue #2296
Description of the problem: It is possible to download wxPython 4.2.0 with python 3.11, but the installation fails with the following error.
Read more >When should you upgrade to Python 3.11?
For example, as of December 2022 the PyLint linter still considers this syntax to be an error. That being said, Python 3.11 has...
Read more >Installation error of scikit-image in python-3.11.0
Getting errors when installing scikit-image with python-3.11.0. · Error messages: · Environment: · Two approaches were suggested: · However, I would ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hope you had a nice adventure, thanks for the links on the debug scripts. I came to the same conclusion as you, which was that we can’t determine the modified rowcount until everything returned by
RETURNING
has been stepped-through.I’m going to close this as it seems that, if anything, Python 3.11 has it correct and the test was only passing due to a side-effect (as far as I can tell) of the statement cache. The faulty assertions are removed from our tests.