Skip to content

Commit

Permalink
add custom report checker; add .replace test
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Landy committed Oct 21, 2024
1 parent 4c2b8ec commit 14431e4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/dev-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ jobs:
- name: Test with pytest
run: |
python -m pytest -vv --cov=. --cov-report=xml
python -m pytest -vv --cov=. --cov-report=json
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}-${{ matrix.python-version }}
path: coverage.xml
path: coverage.json

coverage:
needs: tests
Expand All @@ -55,11 +55,5 @@ jobs:
with:
path: coverage-reports

- name: Install lcov
run: sudo apt-get install lcov

- name: Merge coverage reports
run: 'lcov $(find coverage-reports -name "*xml" | while read -r F ; do echo -a $F ; done) -o coverage-merged.info'

- name: Check coverage
run: lcov --summary coverage-merged.info
run: python3 check_coverage_reports.py --inp-dir coverage-reports --max-allowed-num-uncovered-lines 0
25 changes: 25 additions & 0 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,31 @@ def check_(**kwargs):
return check_


def test_replace():
fmt = Format(
max_value_str_len=1,
objects_details=1,
ellipsis_rel_pos=0.5,
max_exc_str_len=1,
ellipsis_='.',
before=1,
after=1,
color_scheme=None,
skip_files_except=[],
brief_files_except=[],
custom_var_printers=[],
)
fmt2 = fmt.replace(
before=2,
skip_files_except=['f1', 'f2'],
)
assert fmt.max_value_str_len == fmt.max_value_str_len
assert fmt2.before == 2
assert fmt.before == 1
assert fmt2.skip_files_except == ['f1', 'f2']
assert fmt.skip_files_except == []


def test_setattr():
fmt = Format()
fmt.max_value_str_len = 1
Expand Down

0 comments on commit 14431e4

Please sign in to comment.