Skip to content
Snippets Groups Projects
Commit bebcf1af authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Resolve "calculate_mean fails for Python 2"

parent ac910ebc
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ Unreleased changes ...@@ -2,6 +2,7 @@ Unreleased changes
------------------ ------------------
* A bugfix * A bugfix
* Fixed a bug in calculate_mean which was present in python 2.7 envoronments
Version 0 Version 0
......
#!usr/bin/env python #!usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Filename: bar.py # Filename: bar.py
from __future__ import division
""" """
The bar module. The bar module.
""" """
__author__ = "Your Name" __author__ = "Jürgen"
__credits__ = ["The guy in your office", "Tom"] __credits__ = ["The guy in your office", "Tom"]
__license__ = "MIT" __license__ = "MIT"
__maintainer__ = "Your Buddy" __maintainer__ = "Your Buddy"
......
...@@ -8,7 +8,7 @@ from foo.bar import whats_the_meaning_of_life, calculate_mean ...@@ -8,7 +8,7 @@ from foo.bar import whats_the_meaning_of_life, calculate_mean
__author__ = "Your Name" __author__ = "Your Name"
__credits__ = [] __credits__ = []
__license__ = "MIT" __license__ = "MIT"
__maintainer__ = "Your Name" __maintainer__ = "Jürgen"
__email__ = "yname@km3net.de" __email__ = "yname@km3net.de"
...@@ -38,3 +38,6 @@ class TestCalculateMean(TestCase): ...@@ -38,3 +38,6 @@ class TestCalculateMean(TestCase):
def test_calculate_mean_returns_correct_value_for_negative_numbers(self): def test_calculate_mean_returns_correct_value_for_negative_numbers(self):
assert -3 == calculate_mean([-1, -2, -3, -4, -5]) assert -3 == calculate_mean([-1, -2, -3, -4, -5])
def test_calculate_mean_of_some_other_numbers(self):
self.assertAlmostEqual(2.5, calculate_mean([1, 2, 3, 4]))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment