Skip to content

Commit 637a1e8

Browse files
committed
Fill in Python example repo
1 parent 2777cf8 commit 637a1e8

File tree

5 files changed

+37
-0
lines changed

5 files changed

+37
-0
lines changed

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
language: python
2+
sudo: false
3+
python:
4+
- 2.7
5+
- 3.4
6+
script: py.test -v

conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import os
2+
import sys
3+
4+
HERE = os.path.dirname(os.path.abspath(__file__))
5+
6+
sys.path.insert(0, HERE)

hello.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from __future__ import print_function
2+
import sys
3+
4+
5+
def hello(what):
6+
print('Hello, {}!'.format(what))
7+
8+
9+
def say_what():
10+
return 'world'
11+
12+
13+
def main():
14+
hello(say_what())
15+
return 0
16+
17+
18+
if __name__ == '__main__':
19+
sys.exit(main())

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pytest

tests/test_hello.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import hello
2+
3+
4+
def test_says_world():
5+
assert hello.say_what() == 'world'

0 commit comments

Comments
 (0)