Skip to content

Commit 4ddf81e

Browse files
[pre-commit.ci] auto fixes from pre-commit hooks
1 parent 685df37 commit 4ddf81e

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

tests/conftest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
from pathlib import Path
66

77
import pytest
8+
89
import diffpy.srfit.equation.literals as literals
910
from diffpy.srfit.sas.sasimport import sasimport
1011

11-
1212
logger = logging.getLogger(__name__)
1313

1414

@@ -113,6 +113,7 @@ def _datafile(filename):
113113

114114
return _datafile
115115

116+
116117
@pytest.fixture(scope="session")
117118
def make_args():
118119
def _makeArgs(num):
@@ -121,8 +122,10 @@ def _makeArgs(num):
121122
j = i + 1
122123
args.append(literals.Argument(name="v%i" % j, value=j))
123124
return args
125+
124126
return _makeArgs
125127

128+
126129
@pytest.fixture(scope="session")
127130
def noObserversInGlobalBuilders():
128131
def _noObserversInGlobalBuilders():
@@ -139,4 +142,5 @@ def _noObserversInGlobalBuilders():
139142
rv = False
140143
break
141144
return rv
145+
142146
return _noObserversInGlobalBuilders()

tests/test_builder.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def testRegisterArg(make_args, noObserversInGlobalBuilders):
4747
assert noObserversInGlobalBuilders
4848
return
4949

50+
5051
def testRegisterOperator(make_args, noObserversInGlobalBuilders):
5152
"""Try to use an operator without arguments in an equation."""
5253

@@ -80,6 +81,7 @@ def testRegisterOperator(make_args, noObserversInGlobalBuilders):
8081
assert noObserversInGlobalBuilders
8182
return
8283

84+
8385
def testSwapping(make_args, noObserversInGlobalBuilders):
8486

8587
def g1(v1, v2, v3, v4):
@@ -140,6 +142,7 @@ def g2(v1):
140142
assert noObserversInGlobalBuilders
141143
return
142144

145+
143146
def testParseEquation(noObserversInGlobalBuilders):
144147

145148
from numpy import array_equal, divide, e, sin, sqrt
@@ -172,7 +175,6 @@ def testParseEquation(noObserversInGlobalBuilders):
172175
f = lambda x, sigma: sqrt(e ** (-0.5 * (x / sigma) ** 2))
173176
assert numpy.allclose(eq(), f(x, sigma))
174177

175-
176178
assert eq.args == [eq.x, eq.sigma]
177179

178180
# Equation with constants
@@ -193,6 +195,7 @@ def testParseEquation(noObserversInGlobalBuilders):
193195
assert noObserversInGlobalBuilders
194196
return
195197

198+
196199
def test_parse_constant():
197200
"""Verify parsing of constant numeric expressions."""
198201
factory = builder.EquationFactory()
@@ -204,6 +207,7 @@ def test_parse_constant():
204207
eq(3)
205208
return
206209

210+
207211
def testBuildEquation(noObserversInGlobalBuilders):
208212

209213
from numpy import array_equal

tests/utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
# Helper functions for testing -----------------------------------------------
2626

2727

28-
29-
3028
def capturestdout(f, *args, **kwargs):
3129
"""Capture the standard output from a call of function f."""
3230
savestdout = sys.stdout

0 commit comments

Comments
 (0)