diff options
author | Sebastian Berg <sebastianb@nvidia.com> | 2022-10-27 14:57:14 +0200 |
---|---|---|
committer | Sebastian Berg <sebastianb@nvidia.com> | 2022-10-27 14:57:14 +0200 |
commit | 67841947b458f6bdc6c40d014512da9bc4717a3e (patch) | |
tree | 9683bb0863ef40219e3de2fb37013cef209a7edb /numpy/random | |
parent | 2283052fd01138863a5741d84f358fdbea501bd9 (diff) | |
download | numpy-67841947b458f6bdc6c40d014512da9bc4717a3e.tar.gz |
TST,MAINT: Replace most `setup` with `setup_method` (also teardown)
In some cases, the replacement is clearly not what is intended,
in those (where setup was called explicitly), I mostly renamed
`setup` to `_setup`.
The `test_ccompile_opt` is a bit confusing, so left it right now
(this will probably fail)
Diffstat (limited to 'numpy/random')
-rw-r--r-- | numpy/random/tests/test_generator_mt19937.py | 12 | ||||
-rw-r--r-- | numpy/random/tests/test_random.py | 10 | ||||
-rw-r--r-- | numpy/random/tests/test_randomstate.py | 10 |
3 files changed, 16 insertions, 16 deletions
diff --git a/numpy/random/tests/test_generator_mt19937.py b/numpy/random/tests/test_generator_mt19937.py index 73c38676d..1710df8ca 100644 --- a/numpy/random/tests/test_generator_mt19937.py +++ b/numpy/random/tests/test_generator_mt19937.py @@ -147,7 +147,7 @@ class TestMultinomial: class TestMultivariateHypergeometric: - def setup(self): + def setup_method(self): self.seed = 8675309 def test_argument_validation(self): @@ -280,7 +280,7 @@ class TestMultivariateHypergeometric: class TestSetState: - def setup(self): + def setup_method(self): self.seed = 1234567890 self.rg = Generator(MT19937(self.seed)) self.bit_generator = self.rg.bit_generator @@ -707,7 +707,7 @@ class TestRandomDist: # Make sure the random distribution returns the correct value for a # given seed - def setup(self): + def setup_method(self): self.seed = 1234567890 def test_integers(self): @@ -1841,7 +1841,7 @@ class TestRandomDist: class TestBroadcast: # tests that functions that broadcast behave # correctly when presented with non-scalar arguments - def setup(self): + def setup_method(self): self.seed = 123456789 @@ -2454,7 +2454,7 @@ class TestBroadcast: class TestThread: # make sure each state produces the same sequence even in threads - def setup(self): + def setup_method(self): self.seeds = range(4) def check_function(self, function, sz): @@ -2500,7 +2500,7 @@ class TestThread: # See Issue #4263 class TestSingleEltArrayInput: - def setup(self): + def setup_method(self): self.argOne = np.array([2]) self.argTwo = np.array([3]) self.argThree = np.array([4]) diff --git a/numpy/random/tests/test_random.py b/numpy/random/tests/test_random.py index ecda5dab5..6b4c82bc9 100644 --- a/numpy/random/tests/test_random.py +++ b/numpy/random/tests/test_random.py @@ -101,7 +101,7 @@ class TestMultinomial: class TestSetState: - def setup(self): + def setup_method(self): self.seed = 1234567890 self.prng = random.RandomState(self.seed) self.state = self.prng.get_state() @@ -290,7 +290,7 @@ class TestRandomDist: # Make sure the random distribution returns the correct value for a # given seed - def setup(self): + def setup_method(self): self.seed = 1234567890 def test_rand(self): @@ -1048,7 +1048,7 @@ class TestRandomDist: class TestBroadcast: # tests that functions that broadcast behave # correctly when presented with non-scalar arguments - def setup(self): + def setup_method(self): self.seed = 123456789 def setSeed(self): @@ -1617,7 +1617,7 @@ class TestBroadcast: class TestThread: # make sure each state produces the same sequence even in threads - def setup(self): + def setup_method(self): self.seeds = range(4) def check_function(self, function, sz): @@ -1660,7 +1660,7 @@ class TestThread: # See Issue #4263 class TestSingleEltArrayInput: - def setup(self): + def setup_method(self): self.argOne = np.array([2]) self.argTwo = np.array([3]) self.argThree = np.array([4]) diff --git a/numpy/random/tests/test_randomstate.py b/numpy/random/tests/test_randomstate.py index dc539c4ac..be9a9c339 100644 --- a/numpy/random/tests/test_randomstate.py +++ b/numpy/random/tests/test_randomstate.py @@ -185,7 +185,7 @@ class TestMultinomial: class TestSetState: - def setup(self): + def setup_method(self): self.seed = 1234567890 self.random_state = random.RandomState(self.seed) self.state = self.random_state.get_state() @@ -436,7 +436,7 @@ class TestRandomDist: # Make sure the random distribution returns the correct value for a # given seed - def setup(self): + def setup_method(self): self.seed = 1234567890 def test_rand(self): @@ -1310,7 +1310,7 @@ class TestRandomDist: class TestBroadcast: # tests that functions that broadcast behave # correctly when presented with non-scalar arguments - def setup(self): + def setup_method(self): self.seed = 123456789 def set_seed(self): @@ -1896,7 +1896,7 @@ class TestBroadcast: class TestThread: # make sure each state produces the same sequence even in threads - def setup(self): + def setup_method(self): self.seeds = range(4) def check_function(self, function, sz): @@ -1942,7 +1942,7 @@ class TestThread: # See Issue #4263 class TestSingleEltArrayInput: - def setup(self): + def setup_method(self): self.argOne = np.array([2]) self.argTwo = np.array([3]) self.argThree = np.array([4]) |