Skip to content

Commit

Permalink
Fix coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
icemac committed Jan 19, 2024
1 parent 0451595 commit 0b5ae10
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Bi-directional version.cfg <–> requirements.txt synchronization

- [Installation](#installation)
- [Constraints](#constraints)
- [Hacking](#hacking)
- [License](#license)

## Installation
Expand All @@ -25,6 +26,14 @@ pip install vereqsyn
* So `version.cfg` can contain comments, the ones in `requirements.txt` are
lost when running recreate.

## Hacking

### Run the tests

```console
hatch run cov
```

## License

`vereqsyn` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ exclude_lines = [
"if TYPE_CHECKING:",
]
skip_covered = true
show_missing = true
fail_under = 100

[tool.ruff]
# N802: Function name {name} should be lowercase
Expand Down
9 changes: 8 additions & 1 deletion tests/test_vereqsyn.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest

from vereqsyn import VersionCfgRequirementsTxtSync
from vereqsyn import VersionCfgRequirementsTxtSync, ConfigFile


@pytest.fixture(scope="session")
Expand Down Expand Up @@ -85,3 +85,10 @@ def test_VersionCfg_RequirementsTxt_Sync__update__2(fixtures, tmp_path):
assert not component.in_sync()
component.update()
assert component.in_sync()

def test_ConfigFile____post_init____1():
"""It raises a ValueError, if the given file does not exist."""
with pytest.raises(ValueError) as e:
ConfigFile(pathlib.Path('i-do-not-exist.cfg'))
assert e.match("PosixPath\('i-do-not-exist.cfg'\) does not exist\.")

0 comments on commit 0b5ae10

Please sign in to comment.