Skip to content

Commit b6fd33e

Browse files
committed
ignore the deprecation warnings in unit tests
1 parent 7f2a781 commit b6fd33e

3 files changed

Lines changed: 25 additions & 11 deletions

File tree

src/simulation/dynamics/HingedRigidBodies/_UnitTest/test_hingedRigidBodyStateEffector.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
from Basilisk.simulation import extForceTorque
4040
from Basilisk.simulation import spacecraftSystem
4141
from Basilisk.architecture import messaging
42+
from Basilisk.utilities import deprecated
4243

4344
# uncomment this line is this test is to be skipped in the global unit test run, adjust message as needed
4445
# @pytest.mark.skipif(conditionstring)
@@ -68,8 +69,10 @@ def test_hingedRigidBodyMotorTorque(show_plots, useScPlus):
6869
[testResults, testMessage] = hingedRigidBodyMotorTorque(show_plots, useScPlus)
6970
assert testResults < 1, testMessage
7071

72+
7173
def hingedRigidBodyGravity(show_plots):
7274
__tracebackhide__ = True
75+
deprecated.filterwarnings("ignore", "SpacecraftSystem.SpacecraftSystem")
7376

7477
testFailCount = 0 # zero unit test result counter
7578
testMessages = [] # create empty list to store test log messages
@@ -300,6 +303,7 @@ def hingedRigidBodyNoGravity(show_plots):
300303
# the mrp_steering_tracking() function will not be shown unless the
301304
# --fulltrace command line option is specified.
302305
__tracebackhide__ = True
306+
deprecated.filterwarnings("ignore", "SpacecraftSystem.SpacecraftSystem")
303307

304308
testFailCount = 0 # zero unit test result counter
305309
testMessages = [] # create empty list to store test log messages
@@ -531,6 +535,7 @@ def hingedRigidBodyNoGravityDamping(show_plots):
531535
# the mrp_steering_tracking() function will not be shown unless the
532536
# --fulltrace command line option is specified.
533537
__tracebackhide__ = True
538+
deprecated.filterwarnings("ignore", "SpacecraftSystem.SpacecraftSystem")
534539

535540
testFailCount = 0 # zero unit test result counter
536541
testMessages = [] # create empty list to store test log messages
@@ -720,6 +725,7 @@ def hingedRigidBodyThetaSS(show_plots):
720725
# the mrp_steering_tracking() function will not be shown unless the
721726
# --fulltrace command line option is specified.
722727
__tracebackhide__ = True
728+
deprecated.filterwarnings("ignore", "SpacecraftSystem.SpacecraftSystem")
723729

724730
testFailCount = 0 # zero unit test result counter
725731
testMessages = [] # create empty list to store test log messages
@@ -912,6 +918,7 @@ def hingedRigidBodyFrequencyAmp(show_plots):
912918
# the mrp_steering_tracking() function will not be shown unless the
913919
# --fulltrace command line option is specified.
914920
__tracebackhide__ = True
921+
deprecated.filterwarnings("ignore", "SpacecraftSystem.SpacecraftSystem")
915922

916923
testFailCount = 0 # zero unit test result counter
917924
testMessages = [] # create empty list to store test log messages
@@ -1194,6 +1201,7 @@ def hingedRigidBodyMotorTorque(show_plots, useScPlus):
11941201
# the mrp_steering_tracking() function will not be shown unless the
11951202
# --fulltrace command line option is specified.
11961203
__tracebackhide__ = True
1204+
deprecated.filterwarnings("ignore", "SpacecraftSystem.SpacecraftSystem")
11971205

11981206
testFailCount = 0 # zero unit test result counter
11991207
testMessages = [] # create empty list to store test log messages
@@ -1434,6 +1442,7 @@ def hingedRigidBodyLagrangVsBasilisk(show_plots):
14341442
# the mrp_steering_tracking() function will not be shown unless the
14351443
# --fulltrace command line option is specified.
14361444
__tracebackhide__ = True
1445+
deprecated.filterwarnings("ignore", "SpacecraftSystem.SpacecraftSystem")
14371446

14381447
testFailCount = 0 # zero unit test result counter
14391448
testMessages = [] # create empty list to store test log messages
@@ -1877,10 +1886,10 @@ class boxAndWingParameters:
18771886
d = 0
18781887

18791888
if __name__ == "__main__":
1880-
# test_hingedRigidBodyGravity(True)
1881-
# test_hingedRigidBodyNoGravity(True)
1882-
# test_hingedRigidBodyNoGravityDamping(True)
1883-
# test_hingedRigidBodyThetaSS(True)
1884-
# test_hingedRigidBodyFrequencyAmp(True)
1885-
# test_hingedRigidBodyMotorTorque(True, True)
1886-
hingedRigidBodyLagrangVsBasilisk(True)
1889+
hingedRigidBodyGravity(False)
1890+
# hingedRigidBodyNoGravity(True)
1891+
# hingedRigidBodyNoGravityDamping(True)
1892+
# hingedRigidBodyThetaSS(True)
1893+
# hingedRigidBodyFrequencyAmp(True)
1894+
# hingedRigidBodyMotorTorque(True, True)
1895+
# hingedRigidBodyLagrangVsBasilisk(True)

src/simulation/dynamics/dualHingedRigidBodies/_UnitTest/test_dualhingedRigidBodyStateEffector.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
from Basilisk.utilities import pythonVariableLogger
3737
from Basilisk.simulation import spacecraftSystem
3838
from Basilisk.architecture import messaging
39+
from Basilisk.utilities import deprecated
3940

4041
@pytest.mark.parametrize("useFlag, testCase", [
4142
(False, 'NoGravity'),
@@ -60,16 +61,16 @@ def dualHingedRigidBodyTest(show_plots, useFlag, testCase):
6061

6162
testFailCount = 0 # zero unit test result counter
6263
testMessages = [] # create empty list to store test log messages
63-
64+
6465
scObject = spacecraft.Spacecraft()
6566
scObject.ModelTag = "spacecraftBody"
66-
67+
6768
unitTaskName = "unitTask" # arbitrary name (don't change)
6869
unitProcessName = "TestProcess" # arbitrary name (don't change)
69-
70+
7071
# Create a sim module as an empty container
7172
unitTestSim = SimulationBaseClass.SimBaseClass()
72-
73+
7374
# Create test thread
7475
testProcessRate = macros.sec2nano(0.0001) # update process rate update time
7576
testProc = unitTestSim.CreateNewProcess(unitProcessName)
@@ -271,6 +272,7 @@ def dualHingedRigidBodyMotorTorque(show_plots, useScPlus):
271272
# the mrp_steering_tracking() function will not be shown unless the
272273
# --fulltrace command line option is specified.
273274
__tracebackhide__ = True
275+
deprecated.filterwarnings("ignore", "SpacecraftSystem.SpacecraftSystem")
274276

275277
testFailCount = 0 # zero unit test result counter
276278
testMessages = [] # create empty list to store test log messages

src/simulation/dynamics/spacecraftSystem/_UnitTest/test_multiSpacecraft.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from Basilisk.utilities import pythonVariableLogger
3434
from Basilisk.simulation import gravityEffector
3535
from Basilisk.simulation import hingedRigidBodyStateEffector
36+
from Basilisk.utilities import deprecated
3637

3738

3839
def addTimeColumn(time, data):
@@ -66,6 +67,7 @@ def SCConnected(show_plots):
6667
# the mrp_steering_tracking() function will not be shown unless the
6768
# --fulltrace command line option is specified.
6869
__tracebackhide__ = True
70+
deprecated.filterwarnings("ignore", "SpacecraftSystem.SpacecraftSystem")
6971

7072
testFailCount = 0 # zero unit test result counter
7173
testMessages = [] # create empty list to store test log messages
@@ -343,6 +345,7 @@ def SCConnectedAndUnconnected(show_plots):
343345
# the mrp_steering_tracking() function will not be shown unless the
344346
# --fulltrace command line option is specified.
345347
__tracebackhide__ = True
348+
deprecated.filterwarnings("ignore", "SpacecraftSystem.SpacecraftSystem")
346349

347350
testFailCount = 0 # zero unit test result counter
348351
testMessages = [] # create empty list to store test log messages

0 commit comments

Comments
 (0)