mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-03-17 21:32:36 +01:00
CI: Run Python tests (#1001)
This commit is contained in:
parent
35105f951b
commit
0ce992e22e
35
.github/workflows/pr-python-tests.yml
vendored
Normal file
35
.github/workflows/pr-python-tests.yml
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
name: Python Unit Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
backend-check:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
PYTHONPATH: ./backend
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.11'
|
||||
cache: 'pip'
|
||||
cache-dependency-path: |
|
||||
backend/requirements/default.txt
|
||||
backend/requirements/dev.txt
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r backend/requirements/default.txt
|
||||
pip install -r backend/requirements/dev.txt
|
||||
|
||||
- name: Run Tests
|
||||
shell: script -q -e -c "bash --noprofile --norc -eo pipefail {0}"
|
||||
run: py.test -o junit_family=xunit2 -xv --ff backend/tests/unit
|
@ -1,3 +1,4 @@
|
||||
import pathlib
|
||||
import unittest
|
||||
|
||||
from danswer.connectors.cross_connector_utils.html_utils import parse_html_page_basic
|
||||
@ -5,7 +6,8 @@ from danswer.connectors.cross_connector_utils.html_utils import parse_html_page_
|
||||
|
||||
class TestQAPostprocessing(unittest.TestCase):
|
||||
def test_parse_table(self) -> None:
|
||||
with open("./test_table.html", "r") as file:
|
||||
dir_path = pathlib.Path(__file__).parent.resolve()
|
||||
with open(f"{dir_path}/test_table.html", "r") as file:
|
||||
content = file.read()
|
||||
|
||||
parsed = parse_html_page_basic(content)
|
||||
|
Loading…
x
Reference in New Issue
Block a user