python-trio / trio-websocket

WebSocket client and server implementation for Python Trio
MIT License
70 stars 26 forks source link

0.9.2: fixture 'nursery' not found #166

Closed kloczek closed 2 years ago

kloczek commented 2 years ago

This ticket is not bug report but question. I'm trying to build trio-websocket as rpm package and I fond that despyte autogenerated test suite dependencies consisting only of async-generator, pytest, trio, trustme and wsproto modules pytrest is failing in alnost all units with with message "fixture 'nursery' not found".

May I ask whar exactl;y is missing in this case in my build env?

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-trio-websocket-0.9.2-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-trio-websocket-0.9.2-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.10.0, pluggy-0.13.1
rootdir: /home/tkloczko/rpmbuild/BUILD/trio-websocket-0.9.2, configfile: pytest.ini
plugins: rerunfailures-9.1.1, cov-2.12.1, forked-1.3.0, xdist-2.3.0, flake8-1.0.7, shutil-1.7.0, virtualenv-1.7.0
collected 55 items

tests/test_connection.py ssEEEEEEEEEEEEEE.EEEEEEEEsEEEEEEEEEEEEEEEsEEEEEEEEEEEEE                                                                                     [100%]

================================================================================== ERRORS ==================================================================================
_______________________________________________________________ ERROR at setup of test_server_has_listeners ________________________________________________________________
file /home/tkloczko/rpmbuild/BUILD/trio-websocket-0.9.2/tests/test_connection.py, line 182
  async def test_server_has_listeners(nursery):
      server = await nursery.start(serve_websocket, echo_request_handler, HOST, 0,
          None)
      assert len(server.listeners) > 0
      assert isinstance(server.listeners[0], Endpoint)
E       fixture 'nursery' not found
>       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, echo_conn, echo_server, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, virtualenv, worker_id, workspace
>       use 'pytest --fixtures [testpath]' for help on them.

/home/tkloczko/rpmbuild/BUILD/trio-websocket-0.9.2/tests/test_connection.py:182
_______________________________________________________________________ ERROR at setup of test_serve ____________________________________________________________

[..and so on..]
belm0 commented 2 years ago

the packages needed for development, including running of tests, are enumerated here:

https://github.com/HyperionGray/trio-websocket/blob/master/requirements-dev.in

(also see https://github.com/HyperionGray/trio-websocket/blob/master/requirements-dev.txt for pinned versions)

it sounds like you're missing pytest-trio

kloczek commented 2 years ago

Thank you. Inded it was pytest-trio.