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

pytest fails on Windows due to an issue with the pytest-snail plugin that is included in requirements/dev.txt #2908

Open
omry opened this issue Jun 4, 2024 · 1 comment · May be fixed by #2909
Assignees
Labels
bug Something isn't working

Comments

@omry
Copy link
Collaborator

omry commented Jun 4, 2024

======================================================================================================================================================================================================================================= short test summary info =======================================================================================================================================================================================================================================
FAILED tests/test_hydra.py::test_app_with_unicode_config - subprocess.CalledProcessError: Command '['C:\\Users\\omry\\miniconda3\\envs\\hydra\\python.exe', '-Werror', 'tests/test_apps/app_with_unicode_in_config/my_app.py', 'hydra.run.dir=C:\\Users\\omry\\AppData\\Local\\Temp\\pytest-of-omry\\pytest-6\\test_app_with_unicode_config0', 'hydra.job.chdir=True']' returned non-zero exit status 1.
================================================================================================================================================================================================================== 1 failed, 2393 passed, 219 skipped, 1 xfailed in 86.53s (0:01:26) ==================================================================================================================================================================================================================
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\omry\miniconda3\envs\hydra\Scripts\pytest.exe\__main__.py", line 7, in <module>
  File "C:\Users\omry\miniconda3\envs\hydra\Lib\site-packages\_pytest\config\__init__.py", line 206, in console_main
    code = main()
           ^^^^^^
  File "C:\Users\omry\miniconda3\envs\hydra\Lib\site-packages\_pytest\config\__init__.py", line 178, in main
    ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\omry\miniconda3\envs\hydra\Lib\site-packages\pluggy\_hooks.py", line 513, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\omry\miniconda3\envs\hydra\Lib\site-packages\pluggy\_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\omry\miniconda3\envs\hydra\Lib\site-packages\pluggy\_callers.py", line 139, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "C:\Users\omry\miniconda3\envs\hydra\Lib\site-packages\pluggy\_callers.py", line 103, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\omry\miniconda3\envs\hydra\Lib\site-packages\_pytest\main.py", line 332, in pytest_cmdline_main
    return wrap_session(config, _main)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\omry\miniconda3\envs\hydra\Lib\site-packages\_pytest\main.py", line 327, in wrap_session
    config._ensure_unconfigure()
  File "C:\Users\omry\miniconda3\envs\hydra\Lib\site-packages\_pytest\config\__init__.py", line 1135, in _ensure_unconfigure
    self.hook.pytest_unconfigure(config=self)
  File "C:\Users\omry\miniconda3\envs\hydra\Lib\site-packages\pluggy\_hooks.py", line 513, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\omry\miniconda3\envs\hydra\Lib\site-packages\pluggy\_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\omry\miniconda3\envs\hydra\Lib\site-packages\pluggy\_callers.py", line 139, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "C:\Users\omry\miniconda3\envs\hydra\Lib\site-packages\pluggy\_callers.py", line 103, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\omry\miniconda3\envs\hydra\Lib\site-packages\pytest_snail\plugin.py", line 60, in pytest_unconfigure
    config.pluginmanager.unregister("snail_plugin")
  File "C:\Users\omry\miniconda3\envs\hydra\Lib\site-packages\pluggy\_manager.py", line 211, in unregister
    assert name is not None, "plugin is not registered"
           ^^^^^^^^^^^^^^^^
AssertionError: plugin is not registered

@omry omry added the bug Something isn't working label Jun 4, 2024
@omry omry self-assigned this Jun 4, 2024
@omry
Copy link
Collaborator Author

omry commented Jun 4, 2024

removing the plugin (pip uninstall pytest-snail) works around the issue.
The plugin is not critical and was just nice-to-have, I will remove it from the requirements list.

omry added a commit that referenced this issue Jun 4, 2024
@omry omry linked a pull request Jun 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant