Skip to content

Commit 70b98f5

Browse files
committed
Merge pull request gregmalcolm#129 from viprs/master
some small fixes for PEP8
2 parents 34f8cdc + 9c09d40 commit 70b98f5

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

python2/runner/mountain.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@
88
from sensei import Sensei
99
from writeln_decorator import WritelnDecorator
1010

11+
1112
class 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)

python2/runner/sensei.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
#!/usr/bin/env python
22
# encoding: utf-8
33

4-
import sys
5-
import os
64

75
# Taken from legacy python unittest
86
class 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

0 commit comments

Comments
 (0)