Skip to content

Commit

Permalink
0.2 - fix testing
Browse files Browse the repository at this point in the history
  • Loading branch information
wwakabobik committed Oct 17, 2023
1 parent 651f4d8 commit 16876ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 7 additions & 2 deletions examples/test_generator/pytest_runner.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""This module runs pytest and returns the results in JSON format."""
import io
from os import remove

import json
import pytest
Expand Down Expand Up @@ -63,7 +64,11 @@ def parse_error_page(node_name):
"""
parser = PageRetriever()
try:
with open(f"{node_name}.html", "r", encoding="utf-8") as file:
return parser.remove_script_tags(parser.extract_body_content(file))
formatted_content = ''
file_name = f"{node_name}.html"
with open(file_name, "r", encoding="utf-8") as file:
formatted_content = parser.remove_script_tags(parser.extract_body_content(file))
remove(file_name)
return formatted_content
except io.UnsupportedOperation:
return "No page available."
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ webdriver_manager==4.0.1
selenium==4.14.0
pytest==7.4.2
pytest-json-report==1.5.0
pytest-xdist=3.3.1
pytest-xdist==3.3.1
# Third-party-test
cohere==4.27
llamaapi==0.1.36

0 comments on commit 16876ff

Please sign in to comment.