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

Avoid "-" symbol in test name #822

Merged
merged 1 commit into from
Jul 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/sox_io_backend/smoke_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_wav(self, dtype, sample_rate, num_channels):
[8000, 16000],
[1, 2],
[-4.2, -0.2, 0, 0.2, 96, 128, 160, 192, 224, 256, 320],
)), name_func=name_func)
)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify how this is working around the issue?

Copy link
Collaborator Author

@mthrok mthrok Jul 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameterized by default generates simple test names like test_foo_1, test_foo_2, test_foo_3 ...

but since I generate a whole lot of tests, this default naming convention is not very helpful when some of them fail on CI. name_func here changes the naming convention to simply stringify parameters and concatenate them as test name, which is why "-" symbol is included in the test name.

The code change in this PR gives up the custom naming function and use the default naming convention.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know. Are you intentionally leaving some of the custom naming conventions in the other functions?

Copy link
Collaborator Author

@mthrok mthrok Jul 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, they work well in places other than buck or as long as "-" symbol is not included

@skipIfNoMP3
def test_mp3(self, sample_rate, num_channels, bit_rate):
"""Run smoke test on mp3 format"""
Expand All @@ -72,7 +72,7 @@ def test_mp3(self, sample_rate, num_channels, bit_rate):
[8000, 16000],
[1, 2],
[-1, 0, 1, 2, 3, 3.6, 5, 10],
)), name_func=name_func)
)))
def test_vorbis(self, sample_rate, num_channels, quality_level):
"""Run smoke test on vorbis format"""
self.run_smoke_test('vorbis', sample_rate, num_channels, compression=quality_level)
Expand Down