Skip to content

pyctest does not handle None gracefully #6

@carterbox

Description

@carterbox

I forgot to install nose, which means that pyctest was passed a command list which included None.

    # test properties
    props = {
        "DEPENDS": "correct_module",
        "RUN_SERIAL": "ON",
        "LABEL": "unit",
        "WORKING_DIRECTORY": binary_dir,
        "ENVIRONMENT": "TOMOPY_USE_C_ALGORITHMS=1"
        }

    # test command: python $(which coverage) run $(which nosetest)
    cmd = ['/opt/miniconda/envs/travis/bin/python', None, 'run', None]

The resulting RuntimeError was esoteric.

Error running pyctest - Unable to cast Python instance to C++ type (compile in debug mode for details)
Traceback (most recent call last):
  File "pyctest_tomopy.py", line 326, in <module>
    run_pyctest()
  File "pyctest_tomopy.py", line 307, in run_pyctest
    create_nosetest_test(args)
  File "/home/chingd/Documents/tomopy/benchmarking/__init__.py", line 244, in create_nosetest_test
    pyctest.test("nosetests", cmd, props)
RuntimeError: Unable to cast Python instance to C++ type (compile in debug mode for details)

It should probably return a TypeError with a message about how commands cannot be None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions