Commit 88937d2c authored by julian.bauer's avatar julian.bauer
Browse files

Füge einfache Tests hinzu mit pytest

parent 8cbae145
# Nutze einen der nachfolgenden Befehle um Tests auszuführen
`python -m pytest`
`pytest --verbose --pdb`
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Testbeispiele"""
import os
import sys
import pytest
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))),)
import example
class Test_add:
def test_ints(self,):
assert example.add(1, 2, 3) == 6
def test_mixed_numbers(self,):
assert example.add(1, 2, 3.) == 6.
def test_strings(self, ):
assert example.add('a', '2', '3') == 'a23'
def test_mixed_strings_numbers(self, ):
assert example.add('a', 2, '3.', 4.) == 'a23.4.0'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment