question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

test_insert_behavior fails on Python 3.11

See original GitHub issue

While 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:closed
  • Created a year ago
  • Comments:19 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
coleifercommented, Oct 3, 2022

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.

1reaction
coleifercommented, Sep 21, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found