Skip to content

Commit 0b8dec2

Browse files
authored
Merge pull request #181 from pharmaverse/pytest-r-snapshot
2 parents bd16aa6 + 8abd8da commit 0b8dec2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+438
-700
lines changed

.github/workflows/ci-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
pip install -e '.[all]'
3131
- name: Test with pytest
3232
run: |
33-
pip install pytest pytest-cov
33+
pip install pytest pytest-cov pytest-r-snapshot
3434
pytest --cov=rtflite --cov-report=xml
3535
3636
# - name: Upload coverage reports to Codecov
@@ -52,5 +52,5 @@ jobs:
5252
pip install -e '.[all]'
5353
- name: Test with pytest
5454
run: |
55-
pip install pytest pytest-cov
55+
pip install pytest pytest-cov pytest-r-snapshot
5656
pytest --cov=rtflite --cov-report=xml

.github/workflows/mkdocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ jobs:
4141
- name: Install dependencies
4242
run: |
4343
pip install mkdocs-material mkdocstrings-python markdown-exec[ansi] matplotlib
44-
pip install pytest pytest-cov
45-
pip install python-docx
44+
pip install pytest pytest-cov pytest-r-snapshot
45+
pip install python-docx pypdf
4646
pip install -e '.[all]'
4747
pip install --force-reinstall "click<8.2.2" # Workaround for https://github.com/squidfunk/mkdocs-material/issues/8375
4848

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## rtflite 2.5.1
4+
5+
### Testing
6+
7+
- Migrated the RTF snapshot tests implementation to a proper solution
8+
`pytest-r-snapshot` to reduce boilerplate code and improve maintainability.
9+
The legacy fixture generation workflow is removed and the snapshots are
10+
stored under the standard location `tests/__r_snapshots__/` (#181).
11+
312
## rtflite 2.5.0
413

514
### New features

docs/changelog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## rtflite 2.5.1
4+
5+
### Testing
6+
7+
- Migrated the RTF snapshot tests implementation to a proper solution
8+
`pytest-r-snapshot` to reduce boilerplate code and improve maintainability.
9+
The legacy fixture generation workflow is removed and the snapshots are
10+
stored under the standard location `tests/__r_snapshots__/` (#181).
11+
312
## rtflite 2.5.0
413

514
### New features

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ exclude = [
102102
dev = [
103103
"pytest>=8.3.3",
104104
"pytest-cov>=6.0.0",
105+
"pytest-r-snapshot>=0.1.0",
105106
"mkdocs>=1.6.1",
106107
"mkdocs-material>=9.5.45",
107108
"mkdocstrings-python>=1.12.2",

tests/fixtures/r_outputs/test_input_footnote_as_table_false.rtf renamed to tests/__r_snapshots__/test_input/footnote_as_table_false.rtf

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{\rtf1\ansi
22
\deff0\deflang1033
3-
{\fonttbl{\f0\froman\fcharset161\fprq2 Times New Roman;}
3+
{\fonttbl{\f0\froman\fcharset1\fprq2 Times New Roman;}
44
{\f1\froman\fcharset161\fprq2 Times New Roman Greek;}
55
{\f2\fswiss\fcharset161\fprq2 Arial Greek;}
6-
{\f3\fswiss\fcharset161\fprq2 Arial;}
7-
{\f4\fswiss\fcharset161\fprq2 Helvetica;}
8-
{\f5\fswiss\fcharset161\fprq2 Calibri;}
9-
{\f6\froman\fcharset161\fprq2 Georgia;}
10-
{\f7\ffroman\fcharset161\fprq2 Cambria;}
11-
{\f8\fmodern\fcharset161\fprq2 Courier New;}
12-
{\f9\ftech\fcharset161\fprq2 Symbol;}
6+
{\f3\fswiss\fcharset0\fprq2 Arial;}
7+
{\f4\fswiss\fcharset1\fprq2 Helvetica;}
8+
{\f5\fswiss\fcharset1\fprq2 Calibri;}
9+
{\f6\froman\fcharset1\fprq2 Georgia;}
10+
{\f7\ffroman\fcharset1\fprq2 Cambria;}
11+
{\f8\fmodern\fcharset0\fprq2 Courier New;}
12+
{\f9\ftech\fcharset2\fprq2 Symbol;}
1313
}
1414

1515

tests/fixtures/r_outputs/test_input_footnote_as_table_true.rtf renamed to tests/__r_snapshots__/test_input/footnote_as_table_true.rtf

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{\rtf1\ansi
22
\deff0\deflang1033
3-
{\fonttbl{\f0\froman\fcharset161\fprq2 Times New Roman;}
3+
{\fonttbl{\f0\froman\fcharset1\fprq2 Times New Roman;}
44
{\f1\froman\fcharset161\fprq2 Times New Roman Greek;}
55
{\f2\fswiss\fcharset161\fprq2 Arial Greek;}
6-
{\f3\fswiss\fcharset161\fprq2 Arial;}
7-
{\f4\fswiss\fcharset161\fprq2 Helvetica;}
8-
{\f5\fswiss\fcharset161\fprq2 Calibri;}
9-
{\f6\froman\fcharset161\fprq2 Georgia;}
10-
{\f7\ffroman\fcharset161\fprq2 Cambria;}
11-
{\f8\fmodern\fcharset161\fprq2 Courier New;}
12-
{\f9\ftech\fcharset161\fprq2 Symbol;}
6+
{\f3\fswiss\fcharset0\fprq2 Arial;}
7+
{\f4\fswiss\fcharset1\fprq2 Helvetica;}
8+
{\f5\fswiss\fcharset1\fprq2 Calibri;}
9+
{\f6\froman\fcharset1\fprq2 Georgia;}
10+
{\f7\ffroman\fcharset1\fprq2 Cambria;}
11+
{\f8\fmodern\fcharset0\fprq2 Courier New;}
12+
{\f9\ftech\fcharset2\fprq2 Symbol;}
1313
}
1414

1515

tests/fixtures/r_outputs/test_input_rtf_minimal.rtf renamed to tests/__r_snapshots__/test_input/rtf_minimal.rtf

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{\rtf1\ansi
22
\deff0\deflang1033
3-
{\fonttbl{\f0\froman\fcharset161\fprq2 Times New Roman;}
3+
{\fonttbl{\f0\froman\fcharset1\fprq2 Times New Roman;}
44
{\f1\froman\fcharset161\fprq2 Times New Roman Greek;}
55
{\f2\fswiss\fcharset161\fprq2 Arial Greek;}
6-
{\f3\fswiss\fcharset161\fprq2 Arial;}
7-
{\f4\fswiss\fcharset161\fprq2 Helvetica;}
8-
{\f5\fswiss\fcharset161\fprq2 Calibri;}
9-
{\f6\froman\fcharset161\fprq2 Georgia;}
10-
{\f7\ffroman\fcharset161\fprq2 Cambria;}
11-
{\f8\fmodern\fcharset161\fprq2 Courier New;}
12-
{\f9\ftech\fcharset161\fprq2 Symbol;}
6+
{\f3\fswiss\fcharset0\fprq2 Arial;}
7+
{\f4\fswiss\fcharset1\fprq2 Helvetica;}
8+
{\f5\fswiss\fcharset1\fprq2 Calibri;}
9+
{\f6\froman\fcharset1\fprq2 Georgia;}
10+
{\f7\ffroman\fcharset1\fprq2 Cambria;}
11+
{\f8\fmodern\fcharset0\fprq2 Courier New;}
12+
{\f9\ftech\fcharset2\fprq2 Symbol;}
1313
}
1414

1515

tests/fixtures/r_outputs/test_input_source_as_table_false.rtf renamed to tests/__r_snapshots__/test_input/source_as_table_false.rtf

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{\rtf1\ansi
22
\deff0\deflang1033
3-
{\fonttbl{\f0\froman\fcharset161\fprq2 Times New Roman;}
3+
{\fonttbl{\f0\froman\fcharset1\fprq2 Times New Roman;}
44
{\f1\froman\fcharset161\fprq2 Times New Roman Greek;}
55
{\f2\fswiss\fcharset161\fprq2 Arial Greek;}
6-
{\f3\fswiss\fcharset161\fprq2 Arial;}
7-
{\f4\fswiss\fcharset161\fprq2 Helvetica;}
8-
{\f5\fswiss\fcharset161\fprq2 Calibri;}
9-
{\f6\froman\fcharset161\fprq2 Georgia;}
10-
{\f7\ffroman\fcharset161\fprq2 Cambria;}
11-
{\f8\fmodern\fcharset161\fprq2 Courier New;}
12-
{\f9\ftech\fcharset161\fprq2 Symbol;}
6+
{\f3\fswiss\fcharset0\fprq2 Arial;}
7+
{\f4\fswiss\fcharset1\fprq2 Helvetica;}
8+
{\f5\fswiss\fcharset1\fprq2 Calibri;}
9+
{\f6\froman\fcharset1\fprq2 Georgia;}
10+
{\f7\ffroman\fcharset1\fprq2 Cambria;}
11+
{\f8\fmodern\fcharset0\fprq2 Courier New;}
12+
{\f9\ftech\fcharset2\fprq2 Symbol;}
1313
}
1414

1515

tests/fixtures/r_outputs/test_input_source_as_table_true.rtf renamed to tests/__r_snapshots__/test_input/source_as_table_true.rtf

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{\rtf1\ansi
22
\deff0\deflang1033
3-
{\fonttbl{\f0\froman\fcharset161\fprq2 Times New Roman;}
3+
{\fonttbl{\f0\froman\fcharset1\fprq2 Times New Roman;}
44
{\f1\froman\fcharset161\fprq2 Times New Roman Greek;}
55
{\f2\fswiss\fcharset161\fprq2 Arial Greek;}
6-
{\f3\fswiss\fcharset161\fprq2 Arial;}
7-
{\f4\fswiss\fcharset161\fprq2 Helvetica;}
8-
{\f5\fswiss\fcharset161\fprq2 Calibri;}
9-
{\f6\froman\fcharset161\fprq2 Georgia;}
10-
{\f7\ffroman\fcharset161\fprq2 Cambria;}
11-
{\f8\fmodern\fcharset161\fprq2 Courier New;}
12-
{\f9\ftech\fcharset161\fprq2 Symbol;}
6+
{\f3\fswiss\fcharset0\fprq2 Arial;}
7+
{\f4\fswiss\fcharset1\fprq2 Helvetica;}
8+
{\f5\fswiss\fcharset1\fprq2 Calibri;}
9+
{\f6\froman\fcharset1\fprq2 Georgia;}
10+
{\f7\ffroman\fcharset1\fprq2 Cambria;}
11+
{\f8\fmodern\fcharset0\fprq2 Courier New;}
12+
{\f9\ftech\fcharset2\fprq2 Symbol;}
1313
}
1414

1515

0 commit comments

Comments
 (0)