niftools / pyffi

PyFFI is a Python library for processing block structured files.
http://www.niftools.org/pyffi
Other
47 stars 26 forks source link

Refactor/doc tests #44

Closed neomonkeus closed 4 years ago

neomonkeus commented 6 years ago

@niftools/pyffi-reviewer

Overview

Convert remaining text based doctests to run using nose.

Fixes Known Issues

N\A

Documentation

Covered by existing documentation

Testing

All existing test cases passing

Manual

N\A pure automation

Automated

Full regression suite passing

Additional Information

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.4%) to 57.881% when pulling b8d7ea3de01735a39ae63b46b1d725fd7bbe3fdd on neomonkeus:refactor/doc_tests into f2789ea0e03e3d7c6b68c862b4dff74e96a43a9c on niftools:develop.

neomonkeus commented 5 years ago

Travis automation has picked up issues with python 3.7 and some generator functions. Need to investigate if there is a backwards compatible update that will support 3.4 - 3.7

TagnumElite commented 5 years ago

I figured out the problem, my solution was this. Or surround the next() with try-catch StopIteration clause

Example:

def get_triangles(self):
    """Generator for all triangles."""
        if self.faces: ...
        elif self.indices_data:
        it = iter(self.indices_data.indices)
        try:
            while True:
                yield next(it), next(it), next(it)
        except StopIteration:
            pass