File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88from sensei import Sensei
99from writeln_decorator import WritelnDecorator
1010
11+
1112class Mountain :
1213 def __init__ (self ):
1314 self .stream = WritelnDecorator (sys .stdout )
1415 self .tests = path_to_enlightenment .koans ()
1516 self .lesson = Sensei (self .stream )
1617
1718 def walk_the_path (self , args = None ):
18- "Run the koans tests with a custom runner output."
19+ """ Run the koans tests with a custom runner output."" "
1920
20- if args and len (args ) >= 2 :
21+ if args and len (args ) >= 2 :
2122 args .pop (0 )
2223 test_names = ["koans." + test_name for test_name in args ]
2324 self .tests = unittest .TestLoader ().loadTestsFromNames (test_names )
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ def learn(self):
8888 self .stream .writeln ("" )
8989 self .stream .writeln (self .report_progress ())
9090 if self .failures :
91- self .stream .writeln (self .report_remaining ())
91+ self .stream .writeln (self .report_remaining ())
9292 self .stream .writeln ("" )
9393 self .stream .writeln (self .say_something_zenlike ())
9494
Original file line number Diff line number Diff line change 11#!/usr/bin/env python
22# encoding: utf-8
33
4- import sys
5- import os
64
75# Taken from legacy python unittest
86class WritelnDecorator :
97 """Used to decorate file-like objects with a handy 'writeln' method"""
10- def __init__ (self ,stream ):
8+ def __init__ (self , stream ):
119 self .stream = stream
1210
1311 def __getattr__ (self , attr ):
1412 return getattr (self .stream ,attr )
1513
1614 def writeln (self , arg = None ):
17- if arg : self .write (arg )
18- self .write ('\n ' ) # text-mode streams translate to \r\n if needed
15+ if arg :
16+ self .write (arg )
17+ self .write ('\n ' ) # text-mode streams translate to \r\n if needed
1918
You can’t perform that action at this time.
0 commit comments