Commit 0386053a authored by Carlos Ramos Carreño's avatar Carlos Ramos Carreño

Do not import NEO globally.

NEO is still not ported to Python 3.
Importing NEO globally thus makes pytest tests fail during the
assert-rewritting step:
```python
../../venvs/wendelin.core/lib/python3.9/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
    exec(co, module.__dict__)
lib/tests/test_zodb.py:36: in <module>
    from neo.client.Storage import Storage as NEOStorage
../neoppod/neo/client/__init__.py:52: in <module>
    from . import app # set up signal handlers early enough to do it in the main thread
E     File "/srv/slapgrid/slappart66/git/neoppod/neo/client/app.py", line 356
E       except NEOStorageReadRetry, e:
E                                 ^
E   SyntaxError: invalid syntax
```

A MR adding enough support to not fail at import time is proposed in
nexedi/neoppod!24 .
However, that MR will not be reviewed until the vacation period is over.

In the meantime, and as a previous step to make running NEO tests
optional, the import has been moved inside the function loading NEO.
Thus, only the tests that require NEO will fail.
parent fadc5a07
......@@ -33,7 +33,6 @@ from golang import defer, func
from pytest import raises
import pytest; xfail = pytest.mark.xfail
from ZEO.ClientStorage import ClientStorage as ZEOStorage
from neo.client.Storage import Storage as NEOStorage
import os
from six.moves.urllib.parse import quote_plus
......@@ -494,6 +493,7 @@ def test_zstor_2zurl(tmpdir, neo_ssl_dict):
# neo returns new NEO client for specified cluster name and master address.
# NOTE, similarly to ZEO, the client is returned without waiting until server nodes are connected.
def neo(cluster_name, master_addr, ssl=0):
from neo.client.Storage import Storage as NEOStorage
kwargs = dict(master_nodes=master_addr, name=cluster_name)
if ssl:
kwargs.update(neo_ssl_dict)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment