Skip to content

Commit

Permalink
Clean up test_support
Browse files Browse the repository at this point in the history
Remove unused import
Fix a few line endings
  • Loading branch information
pckroon committed Dec 6, 2019
1 parent 0a913bc commit d7f37fb
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions tests/test_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from __future__ import division, print_function
import pytest
import sys
import warnings
from itertools import repeat

from symfit.core.support import (
Expand Down Expand Up @@ -174,18 +173,10 @@ def test_parameters():
assert not x1.fixed
assert not x2.fixed
with pytest.raises(ValueError):
x1, x2 = parameters('x1, x2',
value=[2.0, 1.3, 3.0],
min=0.0
)

x1, x2 = parameters('x1, x2',
value=[2.0, 1.3],
min=[-30, -10],
max=[300, 100],
fixed=[True, False]
)

x1, x2 = parameters('x1, x2', value=[2.0, 1.3, 3.0], min=0.0)

x1, x2 = parameters('x1, x2', value=[2.0, 1.3], min=[-30, -10], max=[300, 100], fixed=[True, False])

assert x1.min == -30
assert x2.min == -10
assert x1.max == 300
Expand All @@ -197,8 +188,7 @@ def test_parameters():

# Illegal bounds
with pytest.raises(ValueError):
x1, x2 = parameters('x1, x2', value=[2.0, 1.3], min=[
400, -10], max=[300, 100])
x1, x2 = parameters('x1, x2', value=[2.0, 1.3], min=[400, -10], max=[300, 100])
# Should not raise any error, as repeat is an endless source of values
x1, x2 = parameters('x1, x2', value=[2.0, 1.3], min=repeat(0.0))

Expand All @@ -214,7 +204,7 @@ def f(self):
return 2

a = A()
# Deleta before a cache was set will fail silently.
# Delete a.f before a cache was set will fail silently.
del a.f
with pytest.raises(AttributeError):
# Cache does not exist before f is called
Expand Down

0 comments on commit d7f37fb

Please sign in to comment.