Skip to content

Commit

Permalink
Add cleanup after test
Browse files Browse the repository at this point in the history
  • Loading branch information
blackary committed Sep 29, 2023
1 parent 483b8a8 commit 466f50a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_edits.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ def before_module():
def before_test(page: Page):
page.goto(f"localhost:{PORT}")

yield

TEST_TEXT = "THIS IS A TEST"

current_text = Path("example_app/example_one.py").read_text()

with Path("example_app/example_one.py").open("w") as f:
f.write(current_text.replace(f"\nst.write('{TEST_TEXT}')\n", ""))


def test_page_update(page: Page):
TEST_TEXT = "THIS IS A TEST"
Expand Down

0 comments on commit 466f50a

Please sign in to comment.