Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken tests by including required assets in package_data #532

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
package_data = [
'models/LICENSE',
'models/README.rst',
'models/beats/201[56]/*',
'models/beats/*/*',
'models/chords/*/*',
'models/chroma/*/*',
'models/downbeats/*/*',
Expand Down
17 changes: 12 additions & 5 deletions tests/test_bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,24 @@


def run_program(program):
# import module, capture stdout
# import module, capture stdout and stderr
test = imp.load_source('test', program[0])
sys.argv = program
backup = sys.stdout
stdout = sys.stdout
stderr = sys.stderr
# redirect stdout and stderr
sys.stdout = StringIO()
sys.stderr = StringIO()
# run the program
data = test.main()
# close stdout, restore environment
sys.stdout.getvalue()
# display stdout and stderr
print(sys.stdout.getvalue(), file=stdout)
print(sys.stderr.getvalue(), file=stderr)
# close and restore environment
sys.stdout.close()
sys.stdout = backup
sys.stderr.close()
sys.stdout = stdout
sys.stderr = stderr
return data


Expand Down