import io, sys output = io.StringIO() sys.stdout = output import __hello__ sys.stdout = sys.__stdout__ Hello_world = lambda: output.getvalue().rstrip('\n')
Hello_Python = lambda: "Hello Python!"- import io, sys
- output = io.StringIO()
- sys.stdout = output
- import __hello__
- sys.stdout = sys.__stdout__
- Hello_world = lambda: output.getvalue().rstrip('\n')
import codewars_test as test # TODO Write tests import solution # or from solution import example # test.assert_equals(actual, expected, [optional] message) @test.describe("Example") def test_group(): @test.it("test case") def test_case(): test.assert_equals(Hello_world(), 'Hello world!')
- import codewars_test as test
- # TODO Write tests
- import solution # or from solution import example
- # test.assert_equals(actual, expected, [optional] message)
- @test.describe("Example")
- def test_group():
- @test.it("test case")
- def test_case():
test.assert_equals(Hello_Python(), 'Hello Python!')- test.assert_equals(Hello_world(), 'Hello world!')