[Tutor] Need help with two similar test cases that I have written. One works and the other fails

Danny Yoo danny.yoo at gmail.com
Sun Feb 7 11:40:17 EST 2016


On Feb 7, 2016 8:38 AM, "Danny Yoo" <danny.yoo at gmail.com> wrote:
>
> :
> >
> >     def test_red_temperature_simulation(self):
> >         """
> >         Method to test the red_temperature_simulation method
> >         """
> >         for i in range(1000000):
> >             test_value = red_temperature_simulation()
> >             self.assertTrue((test_value < 100.0) or (test_value >
103.0),
> >                             msg="Test failed for {}".format(test_value))
> >
> > And now everything works the way it should.
> >
>
> Be careful.  Now you have a test that always succeeds.

No, I'm wrong.  Sorry about that: I misread the numerical range.


More information about the Tutor mailing list