Skip to content

Commit

Permalink
Merge pull request #3459 from Mindful-AI-Assistants/FabianaCampanari-…
Browse files Browse the repository at this point in the history
…patch-1

Update test_code.py
  • Loading branch information
FabianaCampanari authored Oct 18, 2024
2 parents cb88a02 + fe383ab commit 388e922
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test_code.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
# Test file for pytest. This example includes several test functions and uses pytest fixtures for setup and teardown.


import pytest

# Fixture para configuração e limpeza
# "Fixture for setup and cleanup".
@pytest.fixture
def setup_data():
print("\nSetup")
data = {"key1": "value1", "key2": "value2"}
yield data
print("\nCleanup")

# Função de teste usando a fixture
# "Test function using the fixture."
def test_key1(setup_data):
assert setup_data["key1"] == "value1"

# Outra função de teste usando a fixture
# "Another test function using the fixture"
def test_key2(setup_data):
assert setup_data["key2"] == "value2"

# Função de teste sem usar a fixture
# "Test function without using the fixture"
def test_addition():
assert 1 + 1 == 2

0 comments on commit 388e922

Please sign in to comment.