Skip to content

Commit 2a9f5a5

Browse files
committed
Chromium test is not a unit test
Relocate tests/unit/test_chromium.py to tests/integration/test_chromium.py. The chromium test is not a unit test -- it has an external dependency on Chromium. By relocating it to tests/integration, we ensure that the unit tests run without errors. This commit also contains some minor changes to suppress warnings from strict type checkers.
1 parent 43cb0ba commit 2a9f5a5

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

.github/workflows/chromium-validation.yaml renamed to .github/workflows/integration-tests.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: Validate Chrome Integration
1+
name: Integration tests
22

33
on:
44
push:
55
pull_request:
66

77
jobs:
8-
run-validation:
9-
name: Run Integration Tests with Latest Chrome
8+
run-integration-tests:
9+
name: Run Integration Tests
1010
runs-on: ubuntu-latest
1111
env:
1212
CHROME_BIN_PATH: /usr/bin/chromium
@@ -24,11 +24,11 @@ jobs:
2424
run: |
2525
pip install -r requirements.txt
2626
27-
- name: Download and install latest Chrome
27+
- name: Download and install latest Chromium
2828
run: |
2929
sudo apt-get update
3030
sudo apt-get install -y chromium
3131
32-
- name: Run PDF generation integration test
32+
- name: Run integration tests
3333
run: |
34-
python -m unittest process_report.tests.unit.test_chromium
34+
python -m unittest discover -s process_report/tests/integration

process_report/tests/integration/__init__.py

Whitespace-only changes.

process_report/tests/unit/test_chromium.py renamed to process_report/tests/integration/test_chromium.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
from typing import override
23

34
import pandas as pd
45

@@ -8,6 +9,10 @@
89

910

1011
class TestPIInvoiceExport(BaseTestCaseWithTempDir):
12+
invoice_month: str = ""
13+
df: pd.DataFrame = pd.DataFrame()
14+
15+
@override
1116
def setUp(self):
1217
super().setUp()
1318
self.invoice_month = "2024-01"
@@ -42,7 +47,7 @@ def setUp(self):
4247

4348
def test_pi_invoice_pdf_generation(self):
4449
pi_invoice = PIInvoice(
45-
name=self.tempdir, invoice_month=self.invoice_month, data=self.df
50+
name=str(self.tempdir), invoice_month=self.invoice_month, data=self.df
4651
)
4752
pi_invoice.process()
4853
pi_invoice.export()

0 commit comments

Comments
 (0)