Skip to content

TypeError: '>=' not supported between instances of 'int' and 'NoneType' when running the gc #184

Closed
@tardyp

Description

@tardyp

How to reproduce easily

pip install pytest neo4j-driver

write a file 'test_neo.py' :

from neo4j.v1 import GraphDatabase, basic_auth
import os

url = os.environ["NEO4J_URL"]
auth = os.environ["NEO4J_AUTH"].split(":")
d = GraphDatabase.driver(url, auth=basic_auth(*auth), encrypted=False)
s = d.session()


def test_neo():
    with s.begin_transaction() as tx:
        tx.run("MATCH (n) RETURN n LIMIT 1")
0 % pytest testneo.py
============================================================================================================================ test session starts =============================================================================================================================
platform darwin -- Python 3.6.2, pytest-3.2.2, py-1.4.34, pluggy-0.4.0
rootdir: /Users/az02096/dev/nestor/gitlab-celery, inifile:
plugins: celery-4.1.0
collected 1 item

testneo.py .

========================================================================================================================== 1 passed in 0.13 seconds ==========================================================================================================================
Exception ignored in: <bound method Driver.__del__ of <neo4j.v1.direct.DirectDriver object at 0x1088400f0>>
Traceback (most recent call last):
  File "[..].venv/lib/python3.6/site-packages/neo4j/v1/api.py", line 151, in __del__
  File "[..].venv/lib/python3.6/site-packages/neo4j/v1/api.py", line 193, in close
  File "[..].venv/lib/python3.6/site-packages/neo4j/bolt/connection.py", line 439, in close
  File "[..].venv/lib/python3.6/site-packages/neo4j/bolt/connection.py", line 428, in remove
  File "[..].venv/lib/python3.6/site-packages/neo4j/bolt/connection.py", line 346, in close
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/logging/__init__.py", line 1305, in info
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/logging/__init__.py", line 1546, in isEnabledFor
TypeError: '>=' not supported between instances of 'int' and 'NoneType'
Exception ignored in: <bound method Connection.__del__ of <neo4j.bolt.connection.Connection object at 0x1099fb9e8>>
Traceback (most recent call last):
  File "[..].venv/lib/python3.6/site-packages/neo4j/bolt/connection.py", line 190, in __del__
  File "[..].venv/lib/python3.6/site-packages/neo4j/bolt/connection.py", line 346, in close
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/logging/__init__.py", line 1305, in info
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/logging/__init__.py", line 1546, in isEnabledFor
TypeError: '>=' not supported between instances of 'int' and 'NoneType'

Looks like similar issue here:
johanlundberg/neo4j-django-tutorial#10

I am not sire exactly, but it looks like somehow the INFO variable is reset to None at some point. I am not sure if this is because of neo4j-driver or because of pytest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions