Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run pytest for new installation #2421

Open
Xceptions opened this issue Sep 6, 2024 · 2 comments
Open

Unable to run pytest for new installation #2421

Xceptions opened this issue Sep 6, 2024 · 2 comments

Comments

@Xceptions
Copy link

Xceptions commented Sep 6, 2024

When trying to run the tests to be sure that everything works, I keep getting the error below. I have tried upgrading pytest to the latest but no change

(datasetteenv) macbookair@Xceptions-Air datasette % pytest
/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/pytest_asyncio/plugin.py:208: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the fixture caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to function scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
============================= test session starts ==============================
platform darwin -- Python 3.12.1, pytest-8.3.2, pluggy-1.5.0
SQLite: 3.43.1
rootdir: /Users/macbookair/Documents/GitHub/datasette
configfile: pytest.ini
plugins: asyncio-0.24.0, anyio-4.4.0, timeout-2.3.1, xdist-3.6.1
asyncio: mode=Mode.STRICT, default_loop_scope=None
collected 1481 items                                                           

tests/test_package.py ..                                                 [  0%]
tests/test_cli.py .                                                      [  0%]
tests/test_cli_serve_get.py ..                                           [  0%]
tests/test_cli.py .                                                      [  0%]
tests/test_black.py .                                                    [  0%]
tests/test_api.py ...................................................... [  4%]
ss                                                                       [  4%]
tests/test_api_write.py ................................................ [  7%]
...................EEEFEEEEEEEEEEEEEE..EEException ignored in: <function BaseEventLoop.__del__ at 0x107c123e0>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 725, in __del__
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/unix_events.py", line 68, in close
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 104, in close
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 111, in _close_self_pipe
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
E.EEException ignored in: <function BaseEventLoop.__del__ at 0x107c123e0>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 725, in __del__
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/unix_events.py", line 68, in close
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 104, in close
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 111, in _close_self_pipe
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
EEEEException ignored in: <function BaseEventLoop.__del__ at 0x107c123e0>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 725, in __del__
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/unix_events.py", line 68, in close
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 104, in close
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 111, in _close_self_pipe
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
EEEEException ignored in: <function BaseEventLoop.__del__ at 0x107c123e0>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 725, in __del__
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/unix_events.py", line 68, in close
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 104, in close
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 111, in _close_self_pipe
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
EEEEException ignored in: <function BaseEventLoop.__del__ at 0x107c123e0>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 725, in __del__
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/unix_events.py", line 68, in close
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 104, in close
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 111, in _close_self_pipe
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
xxEEException ignored in: <function BaseEventLoop.__del__ at 0x107c123e0>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 725, in __del__
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/unix_events.py", line 68, in close
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 104, in close
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 111, in _close_self_pipe
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
EEEEException ignored in: <function BaseEventLoop.__del__ at 0x107c123e0>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 725, in __del__
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/unix_events.py", line 68, in close
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 104, in close
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 111, in _close_self_pipe
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
EE      [ 12%]
tests/test_auth.py EException ignored in: <function BaseEventLoop.__del__ at 0x107c123e0>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 725, in __del__
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/unix_events.py", line 68, in close
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 104, in close
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 111, in _close_self_pipe
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
Exception ignored in: <function BaseEventLoop.__del__ at 0x107c123e0>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 725, in __del__
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/unix_events.py", line 68, in close
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 104, in close
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 111, in _close_self_pipe
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
E...F......FFFFFFFFFFFF............                  [ 14%]
tests/test_base_view.py ..                                               [ 14%]
tests/test_canned_queries.py .FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF                      [ 17%]
tests/test_cli.py .....F...E.......FFFEF.F
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/_pytest/main.py", line 283, in wrap_session
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/_pytest/main.py", line 337, in _main
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/pluggy/_hooks.py", line 513, in __call__
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/pluggy/_manager.py", line 120, in _hookexec
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/pluggy/_callers.py", line 139, in _multicall
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/_pytest/logging.py", line 805, in pytest_runtestloop
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/_pytest/terminal.py", line 673, in pytest_runtestloop
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/pluggy/_callers.py", line 103, in _multicall
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/_pytest/main.py", line 362, in pytest_runtestloop
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/pluggy/_hooks.py", line 513, in __call__
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/pluggy/_manager.py", line 120, in _hookexec
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/pluggy/_callers.py", line 182, in _multicall
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/pluggy/_result.py", line 100, in get_result
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/pluggy/_callers.py", line 169, in _multicall
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/_pytest/warnings.py", line 109, in pytest_runtest_protocol
INTERNALERROR>   File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/contextlib.py", line 144, in __exit__
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/_pytest/warnings.py", line 67, in catch_warnings_for_item
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/pluggy/_hooks.py", line 535, in call_historic
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/pluggy/_manager.py", line 120, in _hookexec
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/pluggy/_callers.py", line 139, in _multicall
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/pluggy/_callers.py", line 103, in _multicall
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/_pytest/terminal.py", line 558, in pytest_warning_recorded
INTERNALERROR>   File "/Users/macbookair/Documents/GitHub/testdatasette/datasetteenv/lib/python3.12/site-packages/_pytest/warnings.py", line 89, in warning_record_to_str
INTERNALERROR>   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
INTERNALERROR>   File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
INTERNALERROR>   File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
INTERNALERROR>   File "<frozen importlib._bootstrap_external>", line 990, in exec_module
INTERNALERROR>   File "<frozen importlib._bootstrap_external>", line 1127, in get_code
INTERNALERROR>   File "<frozen importlib._bootstrap_external>", line 1185, in get_data
INTERNALERROR> OSError: [Errno 24] Too many open files: '/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tracemalloc.py'

== 55 failed, 171 passed, 2 skipped, 2 xfailed, 22 warnings, 46 errors in 156.24s (0:02:36) ==
sys:1: RuntimeWarning: coroutine 'AsyncToSync.main_wrap' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Exception ignored in: <function BaseEventLoop.__del__ at 0x107c123e0>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 725, in __del__
    self.close()
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/unix_events.py", line 68, in close
    super().close()
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 104, in close
    self._close_self_pipe()
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 111, in _close_self_pipe
    self._remove_reader(self._ssock.fileno())
                        ^^^^^^^^^^^
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
Exception ignored in: <function BaseEventLoop.__del__ at 0x107c123e0>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 725, in __del__
    self.close()
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/unix_events.py", line 68, in close
    super().close()
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 104, in close
    self._close_self_pipe()
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 111, in _close_self_pipe
    self._remove_reader(self._ssock.fileno())
                        ^^^^^^^^^^^
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
Exception ignored in: <function BaseEventLoop.__del__ at 0x107c123e0>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 725, in __del__
    self.close()
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/unix_events.py", line 68, in close
    super().close()
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 104, in close
    self._close_self_pipe()
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 111, in _close_self_pipe
    self._remove_reader(self._ssock.fileno())
                        ^^^^^^^^^^^
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
Exception ignored in: <function BaseEventLoop.__del__ at 0x107c123e0>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 725, in __del__
    self.close()
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/unix_events.py", line 68, in close
    super().close()
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 104, in close
    self._close_self_pipe()
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 111, in _close_self_pipe
    self._remove_reader(self._ssock.fileno())
                        ^^^^^^^^^^^
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
Exception ignored in: <function BaseEventLoop.__del__ at 0x107c123e0>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 725, in __del__
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/unix_events.py", line 68, in close
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 104, in close
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/selector_events.py", line 111, in _close_self_pipe
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'

Might be a wrong guess, but I think some of the tests are no longer compatible with the latest pytest

@Xceptions
Copy link
Author

If you can replicate this issue on your end, then I could work on it @simonw

@Xceptions
Copy link
Author

The problem seems to be from the test_api_write file. I just want to be sure that it is not specific to me before I go ahead to work on it

@Xceptions Xceptions reopened this Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant