Skip to content

Can I run pytest with vsengine? #2

@TobisLee

Description

@TobisLee

I run pytest tests/test_mytest.py, and got some errors:

⩓ pytest tests/test_mytest.py
================================= test session starts ==================================
platform linux -- Python 3.13.3, pytest-8.3.5, pluggy-1.5.0
rootdir: /home/tlss/NAS/encode/repo/encode
configfile: pyproject.toml
plugins: vsengine-0.2.0
collected 0 items / 1 error                                                            
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/_pytest/nodes.py", line 110, in _create
INTERNALERROR>     return super().__call__(*k, **kw)  # type: ignore[no-any-return,misc]
INTERNALERROR>            ~~~~~~~~~~~~~~~~^^^^^^^^^^
INTERNALERROR> TypeError: Can't instantiate abstract class VapoursynthEnvironment without an implementation for abstract method 'runtest'
INTERNALERROR> 
INTERNALERROR> During handling of the above exception, another exception occurred:
INTERNALERROR> 
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/_pytest/main.py", line 283, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>                          ~~~~^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/_pytest/main.py", line 336, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/pluggy/_hooks.py", line 513, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>            ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>            ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/pluggy/_callers.py", line 139, in _multicall
INTERNALERROR>     raise exception.with_traceback(exception.__traceback__)
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR>     teardown.throw(exception)  # type: ignore[union-attr]
INTERNALERROR>     ~~~~~~~~~~~~~~^^^^^^^^^^^
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/_pytest/logging.py", line 790, in pytest_collection
INTERNALERROR>     return (yield)
INTERNALERROR>             ^^^^^
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR>     teardown.throw(exception)  # type: ignore[union-attr]
INTERNALERROR>     ~~~~~~~~~~~~~~^^^^^^^^^^^
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/_pytest/warnings.py", line 121, in pytest_collection
INTERNALERROR>     return (yield)
INTERNALERROR>             ^^^^^
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR>     teardown.throw(exception)  # type: ignore[union-attr]
INTERNALERROR>     ~~~~~~~~~~~~~~^^^^^^^^^^^
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/_pytest/config/__init__.py", line 1417, in pytest_collection
INTERNALERROR>     return (yield)
INTERNALERROR>             ^^^^^
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/pluggy/_callers.py", line 103, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/_pytest/main.py", line 347, in pytest_collection
INTERNALERROR>     session.perform_collect()
INTERNALERROR>     ~~~~~~~~~~~~~~~~~~~~~~~^^
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/_pytest/main.py", line 812, in perform_collect
INTERNALERROR>     hook.pytest_collection_modifyitems(
INTERNALERROR>     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
INTERNALERROR>         session=self, config=self.config, items=items
INTERNALERROR>         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>     )
INTERNALERROR>     ^
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/pluggy/_hooks.py", line 513, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>            ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>            ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/pluggy/_callers.py", line 139, in _multicall
INTERNALERROR>     raise exception.with_traceback(exception.__traceback__)
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR>     teardown.throw(exception)  # type: ignore[union-attr]
INTERNALERROR>     ~~~~~~~~~~~~~~^^^^^^^^^^^
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/_pytest/cacheprovider.py", line 443, in pytest_collection_modifyitems
INTERNALERROR>     res = yield
INTERNALERROR>           ^^^^^
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall
INTERNALERROR>     teardown.throw(exception)  # type: ignore[union-attr]
INTERNALERROR>     ~~~~~~~~~~~~~~^^^^^^^^^^^
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/_pytest/cacheprovider.py", line 373, in pytest_collection_modifyitems
INTERNALERROR>     res = yield
INTERNALERROR>           ^^^^^
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/pluggy/_callers.py", line 103, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/vsengine/tests/pytest.py", line 152, in pytest_collection_modifyitems
INTERNALERROR>     virtual_parent = VapoursynthEnvironment.from_parent(session, name="@vs-engine")
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/_pytest/nodes.py", line 233, in from_parent
INTERNALERROR>     return cls._create(parent=parent, **kw)
INTERNALERROR>            ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/tlss/.uvenv/encode/lib/python3.13/site-packages/_pytest/nodes.py", line 125, in _create
INTERNALERROR>     return super().__call__(*k, **known_kw)  # type: ignore[no-any-return,misc]
INTERNALERROR>            ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
INTERNALERROR> TypeError: Can't instantiate abstract class VapoursynthEnvironment without an implementation for abstract method 'runtest'

============================= 1 warning, 1 error in 0.18s ==============================

It seems the VapoursynthEnvironment class not implement runtest method, so now I have to run pytest -p no:vsengine tests/test_mytest.py to test. I would like to know:

  1. It seems vspreview package is required by vsengine, if I disable the vsengine in test, could it cause some other problems when testting?
  2. If I want to implement the runtest method, what should I do in this method? Is there a reference code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions