Skip to content
Permalink
Browse files

Convert tests to use pytest!

  • Loading branch information...
captainhammy committed Sep 20, 2019
1 parent 830607a commit 734c4c4c56b4717ae3097ff114c95955f3b0d4b1
Showing with 7,252 additions and 6,951 deletions.
  1. +4 −0 .coveragerc
  2. +1 −0 python/ht/events/events/rop_render.py
  3. +3 −15 python/ht/logging/adapters.py
  4. +3 −3 python/ht/logging/shellio.py
  5. +1 −1 python/ht/nodes/styles/manager.py
  6. +17 −86 python/ht/pyfilter/operations/deepimage.py
  7. +22 −84 python/ht/pyfilter/operations/ipoverrides.py
  8. +2 −12 python/ht/pyfilter/operations/primaryimage.py
  9. +1 −5 python/ht/pyfilter/operations/zdepth.py
  10. +3 −9 python/ht/sohohooks/aovs/aov.py
  11. +2 −2 requirements.txt
  12. +159 −43 tests/conftest.py
  13. +164 −153 tests/events/events/test_rop_render.py
  14. +4 −6 tests/events/events/test_scene_load.py
  15. +45 −55 tests/events/test_callbacks.py
  16. +73 −67 tests/events/test_event.py
  17. +9 −12 tests/events/test_group.py
  18. +116 −91 tests/events/test_item.py
  19. +165 −161 tests/events/test_manager.py
  20. +214 −210 tests/events/test_stats.py
  21. +1,860 −1,584 tests/inline/test_api.py
  22. +147 −132 tests/inline/test_utils.py
  23. +128 −128 tests/logging/test_adapters.py
  24. +52 −39 tests/logging/test_shellio.py
  25. +9 −14 tests/nodes/styles/test_event.py
  26. +451 −428 tests/nodes/styles/test_manager.py
  27. +217 −201 tests/nodes/styles/test_styles.py
  28. +75 −78 tests/nodes/test_badges.py
  29. +4 −4 tests/pyfilter/operations/conftest.py
  30. +246 −284 tests/pyfilter/operations/test_deepimage.py
  31. +409 −509 tests/pyfilter/operations/test_ipoverrides.py
  32. +43 −42 tests/pyfilter/operations/test_logoutput.py
  33. +44 −22 tests/pyfilter/operations/test_operation.py
  34. +93 −85 tests/pyfilter/operations/test_primaryimage.py
  35. +369 −296 tests/pyfilter/operations/test_setproperties.py
  36. +54 −53 tests/pyfilter/operations/test_settilecallback.py
  37. +115 −110 tests/pyfilter/operations/test_zdepth.py
  38. +152 −138 tests/pyfilter/test_manager.py
  39. +109 −105 tests/pyfilter/test_property.py
  40. +21 −17 tests/pyfilter/test_utils.py
  41. +865 −914 tests/sohohooks/aovs/test_aov.py
  42. +536 −520 tests/sohohooks/aovs/test_manager.py
  43. +56 −43 tests/sohohooks/test_manager.py
  44. +8 −15 tests/ui/menus/test_opmenu.py
  45. +181 −175 tests/ui/menus/test_parmmenu.py
@@ -39,6 +39,10 @@ omit =
*tests*
*__init__*

disable_warnings =
module-not-imported
module-not-measured

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
@@ -121,6 +121,7 @@ def post_render(self, scriptargs):
else:
_logger.info("Completed Render")


def post_write(self, scriptargs): # pylint: disable=no-self-use
"""Action run after the frame is written to disk.
@@ -82,11 +82,7 @@ def __new__(cls, *args, **kwargs): # pylint: disable=unused-argument

@property
def dialog(self):
"""Whether or not the dialog will be displayed.
:rtype: bool
"""
"""bool: Whether or not the dialog will be displayed."""
return self._dialog

@dialog.setter
@@ -97,11 +93,7 @@ def dialog(self, dialog):

@property
def node(self):
"""A node the logger is associated with.
:rtype: hou.Node or None
"""
"""hou.Node or None: A node the logger is associated with."""
return self._node

@node.setter
@@ -112,11 +104,7 @@ def node(self, node):

@property
def status_bar(self):
"""Whether or not the message will be logged to the status bar.
:rtype: bool
"""
"""bool: Whether or not the message will be logged to the status bar."""
return self._status_bar

@status_bar.setter
@@ -41,15 +41,15 @@ def emit(self, record):
"""
try:
# Format the message
msg = self.format(record)

# Get the current stdout stream.
stream = sys.stdout

# If the stream is really an output to a Python Shell then write
# the message to it.
if isinstance(stream, hou.ShellIO):
# Format the message
msg = self.format(record)

stream.write(msg)
stream.write('\n')
stream.flush()
@@ -153,7 +153,7 @@ def _get_manager_generator_style(self, node_type):
return self._resolve_rule(category_rules[constants.GENERATOR_TYPE_KEY])

else:
raise hou.OperationFailed(
raise ValueError(
"{} is not a manager or a generator type".format(
node_type.nameWithCategory()
)
@@ -95,140 +95,71 @@ def all_passes(self):
"""bool: Modify deep resolver during all render types."""
return self._all_passes

@all_passes.setter
def all_passes(self, all_passes):
self._all_passes = all_passes

# -------------------------------------------------------------------------

@property
def compositing(self):
"""int: Pre-composite the samples."""
return self._compositing

@compositing.setter
def compositing(self, compositing):
self._compositing = compositing

# -------------------------------------------------------------------------

@property
def deepcompression(self):
"""int: Compression value."""
return self._deepcompression

@deepcompression.setter
def deepcompression(self, deepcompression):
self._deepcompression = deepcompression

# -------------------------------------------------------------------------

@property
def depth_planes(self):
"""str: Special planes."""
return self._depth_planes

@depth_planes.setter
def depth_planes(self, depth_planes):
self._depth_planes = depth_planes

# -------------------------------------------------------------------------

@property
def disable_deep_image(self):
"""bool: Disable deep image generation."""
return self._disable_deep_image

@disable_deep_image.setter
def disable_deep_image(self, disable_deep_image):
self._disable_deep_image = disable_deep_image

# -------------------------------------------------------------------------

@property
def filename(self):
"""The deep image path to set."""
return self._filename

@filename.setter
def filename(self, filename):
self._filename = filename

# -------------------------------------------------------------------------

@property
def mipmaps(self):
"""int: Create MIP mapped images."""
return self._mipmaps

@mipmaps.setter
def mipmaps(self, mipmaps):
self._mipmaps = mipmaps

# -------------------------------------------------------------------------

@property
def ofsize(self):
"""int: The opacity storage size."""
return self._ofsize

@ofsize.setter
def ofsize(self, ofsize):
self._ofsize = ofsize

# -------------------------------------------------------------------------

@property
def ofstorage(self):
"""str: The opacity bit depth."""
return self._ofstorage

@ofstorage.setter
def ofstorage(self, ofstorage):
self._ofstorage = ofstorage

# -------------------------------------------------------------------------

@property
def pzstorage(self):
"""str: The depth bit depth."""
return self._pzstorage

@pzstorage.setter
def pzstorage(self, pzstorage):
self._pzstorage = pzstorage

# -------------------------------------------------------------------------

@property
def resolver(self):
"""str: The type of deep to generate."""
return self._resolver

@resolver.setter
def resolver(self, resolver):
self._resolver = resolver

# -------------------------------------------------------------------------

@property
def zbias(self):
"""float: Compression bias."""
return self._zbias

@zbias.setter
def zbias(self, zbias):
self._zbias = zbias

# -------------------------------------------------------------------------
# STATIC METHODS
# -------------------------------------------------------------------------

@staticmethod
def build_arg_string(disable_deep_image=None, deep_all_passes=None, # pylint: disable=arguments-differ,too-many-arguments
deep_image_path=None, resolver=None, compositing=None,
compression=None, depth_planes=None, mipmaps=None,
ofsize=None, ofstorage=None, pzstorage=None, zbias=None):
def build_arg_string(disable_deep_image=None, # pylint: disable=arguments-differ,too-many-arguments
deep_all_passes=None, deep_image_path=None, resolver=None,
compositing=None, compression=None, depth_planes=None,
mipmaps=None, ofsize=None, ofstorage=None, pzstorage=None,
zbias=None):
"""Build an argument string for this operation.
:param disable_deep_image: Whether or not to disable the deep image.
@@ -400,40 +331,40 @@ def process_parsed_args(self, filter_args):
"""
if filter_args.disable_deep_image:
self.disable_deep_image = True
self._disable_deep_image = True

if filter_args.deep_all_passes:
self.all_passes = True
self._all_passes = True

if filter_args.deep_image_path is not None:
self.filename = filter_args.deep_image_path
self._filename = filter_args.deep_image_path

if filter_args.deep_resolver is not None:
self.resolver = filter_args.deep_resolver
self._resolver = filter_args.deep_resolver

if filter_args.deep_compositing is not None:
self.compositing = filter_args.deep_compositing
self._compositing = filter_args.deep_compositing

if filter_args.deep_compression is not None:
self.deepcompression = filter_args.deep_compression
self._deepcompression = filter_args.deep_compression

if filter_args.deep_depth_planes is not None:
self.depth_planes = filter_args.deep_depth_planes
self._depth_planes = filter_args.deep_depth_planes

if filter_args.deep_mipmaps is not None:
self.mipmaps = filter_args.deep_mipmaps
self._mipmaps = filter_args.deep_mipmaps

if filter_args.deep_ofsize is not None:
self.ofsize = filter_args.deep_ofsize
self._ofsize = filter_args.deep_ofsize

if filter_args.deep_ofstorage is not None:
self.ofstorage = filter_args.deep_ofstorage
self._ofstorage = filter_args.deep_ofstorage

if filter_args.deep_pzstorage is not None:
self.pzstorage = filter_args.deep_pzstorage
self._pzstorage = filter_args.deep_pzstorage

if filter_args.deep_zbias is not None:
self.zbias = filter_args.deep_zbias
self._zbias = filter_args.deep_zbias

def should_run(self):
"""Determine whether or not this operation should be run.

0 comments on commit 734c4c4

Please sign in to comment.
You can’t perform that action at this time.