Skip to content

Commit

Permalink
Merge pull request #92 from launchableinc/go-test
Browse files Browse the repository at this point in the history
go_test -> go-test
  • Loading branch information
kohsuke authored Jan 14, 2021
2 parents 3dc2ed2 + 1ca3b74 commit b4f32d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion launchable/test_runners/launchable.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ def cmdname(f):
"""figure out the sub-command name from a test runner function"""

# a.b.cde -> cde
#
# In python module name the conventional separator is '_' but in command name,
# it is '-', so we do replace that
m = f.__module__
return m[m.rindex('.')+1:]
return m[m.rindex('.')+1:].replace('_','-')


def wrap(f, group):
Expand Down
4 changes: 2 additions & 2 deletions tests/commands/test_record_tests_go_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_subset(self, mock_post):
runner = CliRunner()
pipe = "TestExample1\nTestExample2\nTestExample3\nTestExample4\nok github.com/launchableinc/rocket-car-gotest 0.268s"
result = runner.invoke(main, [
'subset', '--target', '10%', '--session', self.session, 'go_test'], input=pipe)
'subset', '--target', '10%', '--session', self.session, 'go-test'], input=pipe)

self.assertEqual(result.exit_code, 0)

Expand All @@ -43,7 +43,7 @@ def test_subset(self, mock_post):
def test_record_tests(self, mock_post):
runner = CliRunner()
result = runner.invoke(main, ['record', 'tests', '--session',
self.session, 'go_test', str(self.test_files_dir) + "/"])
self.session, 'go-test', str(self.test_files_dir) + "/"])
self.assertEqual(result.exit_code, 0)

for (args, kwargs) in mock_post.call_args_list:
Expand Down

0 comments on commit b4f32d3

Please sign in to comment.