Skip to content

Commit

Permalink
Check for raising of warning within the test function
Browse files Browse the repository at this point in the history
  • Loading branch information
Bachibouzouk committed Mar 18, 2024
1 parent 3d864d2 commit 0c65148
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions tests/test_func_time_zero.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


def test_skip_when_func_time_zero():

# Generate test user and appliance
user = User(user_name="Test User", num_users=1)
appliance = user.add_appliance(
Expand Down Expand Up @@ -34,13 +33,10 @@ def test_skip_when_func_time_zero():

def test_warning_when_func_time_zero():
user = User(user_name="Test User", num_users=1)
appliance = user.add_appliance(
name="Test Appliance",
func_time=0, # Set func_time to be 0
func_cycle=20,
time_fraction_random_variability=0.1,
)


with pytest.warns():
test_warning_when_func_time_zero()
with pytest.warns():
appliance = user.add_appliance(
name="Test Appliance",
func_time=0, # Set func_time to be 0
func_cycle=20,
time_fraction_random_variability=0.1,
)

0 comments on commit 0c65148

Please sign in to comment.