Skip to content

Commit cee2848

Browse files
committedMay 22, 2022
less duplicated code
1 parent 040cc82 commit cee2848

File tree

4 files changed

+24
-40
lines changed

4 files changed

+24
-40
lines changed
 

‎tests/test_aero_data.py

+2-12
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# Author: Sylwester Arabas #
55
####################################################################################################
66

7-
import gc
87
import PyPartMC as ppmc
98

109

@@ -20,14 +19,5 @@ def test_ctor():
2019
assert sut is not None
2120

2221
@staticmethod
23-
def test_dtor():
24-
# arrange
25-
sut = ppmc.AeroData() # pylint: disable=unused-variable
26-
gc.collect()
27-
28-
# act
29-
sut = None
30-
gc.collect()
31-
32-
# assert
33-
pass
22+
def test_std():
23+
pass # TODO

‎tests/test_dtors.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import pytest
2+
import gc
3+
import PyPartMC as ppmc
4+
5+
6+
@pytest.mark.parametrize('instantiate', (
7+
pytest.param(lambda : ppmc.GasData(("SO2",)), id='GasData'),
8+
pytest.param(lambda : ppmc.AeroData(), id='AeroData'),
9+
pytest.param(lambda : ppmc.GasState(), id='GasState')
10+
))
11+
def test_dtors(instantiate):
12+
# arrange
13+
sut = instantiate() # pylint: disable=unused-variable
14+
gc.collect()
15+
16+
# act
17+
sut = None
18+
gc.collect()
19+
20+
# assert
21+
pass
22+

‎tests/test_gas_data.py

-14
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# Author: Sylwester Arabas #
55
####################################################################################################
66

7-
import gc
87
import json
98
import PyPartMC as ppmc
109

@@ -21,19 +20,6 @@ def test_ctor():
2120
# assert
2221
assert sut is not None
2322

24-
@staticmethod
25-
def test_dtor():
26-
# arrange
27-
sut = ppmc.GasData(("SO2",)) # pylint: disable=unused-variable
28-
gc.collect()
29-
30-
# act
31-
sut = None
32-
gc.collect()
33-
34-
# assert
35-
pass
36-
3723
@staticmethod
3824
def test_len():
3925
# arrange

‎tests/test_gas_state.py

-14
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
# TODO
88
# pylint: disable=unused-variable
99

10-
import gc
1110
import pytest
1211
#import numpy as np
1312
import PyPartMC as ppmc
@@ -50,19 +49,6 @@ def test_ctor_valid():
5049
# assert
5150
# TODO assert isinstance(sut, ppmc.GasState)
5251

53-
@staticmethod
54-
def test_dtor():
55-
# arrange
56-
sut = ppmc.GasState()
57-
gc.collect()
58-
59-
# act
60-
sut = None
61-
gc.collect()
62-
63-
# assert
64-
pass
65-
6652
@staticmethod
6753
def test_len_empty():
6854
# arrange

0 commit comments

Comments
 (0)
Please sign in to comment.