beetbox / beetbox/beets

test_command_output in test_util.py doesn't work on py3 unless test_embedart.py happens first

Open
#2,162 3 comments 0 reactions 1 assignee Claimed by @JesseWeinstein View on GitHub
embedart testing
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

``` shell
$ tox -e py35-test test/test_util.py

======================================================================
ERROR: test_command_output (test.test_util.UtilTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/johnny/src/beets/.tox/py35-test/lib/python3.5/site-packages/mock/mock.py", line 1305, in patched
return func(*args, **keywargs)
File "/home/johnny/src/beets/test/test_util.py", line 116, in test_command_output
util.command_output([b"taga", b"\xc3\xa9"])
File "/home/johnny/src/beets/beets/util/__init__.py", line 779, in command_output
close_fds=platform.system() != 'Windows',
File "/usr/lib64/python3.5/platform.py", line 1097, in system
return uname().system
File "/usr/lib64/python3.5/platform.py", line 1063, in uname
processor = _syscmd_uname('-p', '')
File "/usr/lib64/python3.5/platform.py", line 817, in _syscmd_uname
f = os.popen('uname %s 2> %s' % (option, DEV_NULL))
File "/home/johnny/src/beets/.tox/py35-test/lib64/python3.5/os.py", line 994, in popen
return _wrap_close(io.TextIOWrapper(proc.stdout), proc)
TypeError: an integer is required (got type Mock)
```

while

`$ tox -e py35-test test/test_embedart.py test/test_util.py`

works perfectly.

They both mock subprocess, that's how i made the educated guess here.

@JesseWeinstein: do you think you can take a look?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.