enthought / enthought/mayavi

runtests.py test runner fails under Python 3.

Open
#885 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Python
Stars
1.4k
Forks
316
Avg merge
7h 44m
Merged PRs (30d)
5

Description

When running the Mayavi tests using the `runtests.py` test runner (for example, by executing `mayavi2 -t` at the command line), the test runner fails with the following output:

```
(mayavi-3.7) mirzakhani:mayavi mdickinson$ mayavi2 -t
----------------------------------------------------------------------
Running TVTK tests.
Traceback (most recent call last):
File "/Users/mdickinson/.venvs/mayavi-3.7/bin/mayavi2", line 11, in
load_entry_point('mayavi', 'gui_scripts', 'mayavi2')()
File "/Users/mdickinson/.venvs/mayavi-3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/Users/mdickinson/.venvs/mayavi-3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
return ep.load()
File "/Users/mdickinson/.venvs/mayavi-3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2443, in load
return self.resolve()
File "/Users/mdickinson/.venvs/mayavi-3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2449, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/Users/mdickinson/Enthought/ETS/mayavi/mayavi/scripts/mayavi2.py", line 427, in
runtests.main()
File "/Users/mdickinson/Enthought/ETS/mayavi/mayavi/tests/runtests.py", line 225, in main
status = m2_tests(verbose)
File "/Users/mdickinson/Enthought/ETS/mayavi/mayavi/tests/runtests.py", line 179, in m2_tests
err = run(tests, verbose)
File "/Users/mdickinson/Enthought/ETS/mayavi/mayavi/tests/runtests.py", line 124, in run
res = re.search(r'Ran\s*(\d*)\s*test', err)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/re.py", line 183, in search
return _compile(pattern, flags).search(string)
TypeError: cannot use a string pattern on a bytes-like object
```

This is with the current master of Mayavi, Python 3.7.6, on macOS 10.14.6, VTK 8.1.2.

This looks like a straightforward Python 2 -> Python 3 porting problem: on Python 3, the subprocess output needs to be decoded before we can apply a regex to it.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in mayavi/tests/runtests.py, especially run around line 124, and reproduce the failure with mayavi2 -t under Python 3. Check how the subprocess output is passed to re.search. Done means the test runner handles that output without the reported bytes/string TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.