Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
language: python
CI: true
sudo: false
python:
- 2.7
- 3.4
- 3.7
before_script: echo "Printing before script"
script: py.test -v
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# python-example
[![Build Status](https://travis-ci.org/redxm-x/python-example.svg?branch=master)](https://travis-ci.org/redxm-x/python-example)
# python-example
9 changes: 9 additions & 0 deletions hello.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,18 @@ def hello(what):
def say_what():
return 'world'

def add_numbers(a, b):
result = a+b
return result

def main():
hello(say_what())
add_numbers(2, 2)
add_numbers(3, 3)
add_numbers(4, 4)
add_numbers(5, 5)
print('lol1')
print('xd')
return 0


Expand Down
12 changes: 9 additions & 3 deletions tests/test_hello.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import hello
from hello import *


def test_says_world():
assert hello.say_what() == 'world'
def test_1():
assert add_numbers(2, 2) == 4
def test_2():
assert add_numbers(3, 3) == 6
def test_3():
assert add_numbers(4, 4) == 8
def test_4():
assert add_numbers(5, 5) == 10