mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
added more tests, added support for coverage
This commit is contained in:
parent
c1de475c58
commit
ed57514579
3 changed files with 35 additions and 1 deletions
15
.gitignore
vendored
15
.gitignore
vendored
|
|
@ -12,3 +12,18 @@ __pycache__/
|
|||
# Editor backup files #
|
||||
#######################
|
||||
*~
|
||||
|
||||
# Unit test / coverage reports
|
||||
##############################
|
||||
htmlcov/
|
||||
.tox/
|
||||
.nox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
/coverage
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*.cover
|
||||
.hypothesis/
|
||||
.pytest_cache/
|
||||
|
|
|
|||
0
pype/.coveragerc
Normal file
0
pype/.coveragerc
Normal file
|
|
@ -6,7 +6,7 @@ from pype.lib import filter_pyblish_plugins
|
|||
import os
|
||||
|
||||
|
||||
def test_pyblish_plugin_filter(printer, monkeypatch):
|
||||
def test_pyblish_plugin_filter_modifier(printer, monkeypatch):
|
||||
"""
|
||||
Test if pyblish filter can filter and modify plugins on-the-fly.
|
||||
"""
|
||||
|
|
@ -39,3 +39,22 @@ def test_pyblish_plugin_filter(printer, monkeypatch):
|
|||
assert plugins[0].optional is True
|
||||
|
||||
lib.teardown()
|
||||
|
||||
|
||||
def test_pyblish_plugin_filter_removal(monkeypatch):
|
||||
""" Test that plugin can be removed by filter """
|
||||
lib.setup_empty()
|
||||
monkeypatch.setitem(os.environ, 'PYBLISHPLUGINPATH', '')
|
||||
plugins = pyblish.api.registered_plugins()
|
||||
|
||||
class MyTestRemovedPlugin(pyblish.api.InstancePlugin):
|
||||
my_test_property = 1
|
||||
label = "Collect Renderable Camera(s)"
|
||||
hosts = ["test"]
|
||||
families = ["default"]
|
||||
|
||||
pyblish.api.register_host("test")
|
||||
pyblish.api.register_plugin(MyTestRemovedPlugin)
|
||||
pyblish.api.register_discovery_filter(filter_pyblish_plugins)
|
||||
plugins = pyblish.api.discover()
|
||||
assert len(plugins) == 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue