Skip to content
Snippets Groups Projects

Clean up and Bug Fixes

Merged Markus Holzer requested to merge holzer/pystencils:Fixes into master
1 file
+ 4
4
Compare changes
  • Side-by-side
  • Inline
+ 4
4
import distutils
import io
import os
import sys
from contextlib import redirect_stdout
from importlib import import_module
@@ -11,6 +10,7 @@ import versioneer
try:
import cython # noqa
USE_CYTHON = True
except ImportError:
USE_CYTHON = False
@@ -32,13 +32,13 @@ class SimpleTestRunner(distutils.cmd.Command):
@staticmethod
def _run_tests_in_module(test):
"""Short test runner function - to work also if py.test is not installed."""
test = 'pystencils_tests.' + test
test = f'pystencils_tests.{test}'
mod, function_name = test.rsplit('.', 1)
if isinstance(mod, str):
mod = import_module(mod)
func = getattr(mod, function_name)
print(f" -> {function_name} in {mod.__name__}" )
print(f" -> {function_name} in {mod.__name__}")
with redirect_stdout(io.StringIO()):
func()
@@ -76,7 +76,7 @@ def cython_extensions(*extensions):
def get_cmdclass():
cmdclass={"quicktest": SimpleTestRunner}
cmdclass = {"quicktest": SimpleTestRunner}
cmdclass.update(versioneer.get_cmdclass())
return cmdclass
Loading