Skip to content

Commit

Permalink
Improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
TLCFEM committed Mar 29, 2024
1 parent 6c7cc8b commit 5f1c9f5
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 16 deletions.
22 changes: 22 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --all-extras --annotation-style=line --output-file=requirements-dev.txt pyproject.toml
#
bitarray==2.9.2 # via msglc (pyproject.toml)
black==24.3.0 # via msglc (pyproject.toml)
click==8.1.7 # via black
coverage[toml]==7.4.4 # via pytest-cov
iniconfig==2.0.0 # via pytest
msgpack==1.0.8 # via msglc (pyproject.toml)
mypy-extensions==1.0.0 # via black
packaging==24.0 # via black, pytest
pathspec==0.12.1 # via black
platformdirs==4.2.0 # via black
pluggy==1.4.0 # via pytest
py-cpuinfo==9.0.0 # via pytest-benchmark
pytest==8.1.1 # via pytest-benchmark, pytest-cov
pytest-benchmark==4.0.0 # via msglc (pyproject.toml)
pytest-cov==5.0.0 # via msglc (pyproject.toml)
ruff==0.3.4 # via msglc (pyproject.toml)
17 changes: 1 addition & 16 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --annotation-style=line --extra=dev pyproject.toml
# pip-compile --annotation-style=line pyproject.toml
#
bitarray==2.9.2 # via msglc (pyproject.toml)
black==24.3.0 # via msglc (pyproject.toml)
click==8.1.7 # via black
colorama==0.4.6 # via click, pytest
coverage[toml]==7.4.4 # via pytest-cov
iniconfig==2.0.0 # via pytest
msgpack==1.0.8 # via msglc (pyproject.toml)
mypy-extensions==1.0.0 # via black
packaging==24.0 # via black, pytest
pathspec==0.12.1 # via black
platformdirs==4.2.0 # via black
pluggy==1.4.0 # via pytest
py-cpuinfo==9.0.0 # via pytest-benchmark
pytest==8.1.1 # via pytest-benchmark, pytest-cov
pytest-benchmark==4.0.0 # via msglc (pyproject.toml)
pytest-cov==5.0.0 # via msglc (pyproject.toml)
ruff==0.3.4 # via msglc (pyproject.toml)
22 changes: 22 additions & 0 deletions scripts/pip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

SCRIPT_DIR=$(realpath "$0")
SCRIPT_DIR=$(dirname "$SCRIPT_DIR")
SCRIPT_DIR=$(dirname "$SCRIPT_DIR")
cd "$SCRIPT_DIR" || exit

if ! command -v pip-compile &> /dev/null
then
if [ -f ".venv/bin/activate" ]; then
source .venv/bin/activate
pip install pip-tools
else
echo "pip-compile could not be found"
exit
fi
fi

pip-compile -r -U --annotation-style=line pyproject.toml
pip-compile -r -U --annotation-style=line --all-extras --output-file=requirements-dev.txt pyproject.toml

cd ..
8 changes: 8 additions & 0 deletions tests/test_msglc.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,14 @@ def test_combine_archives_append(tmpdir, json_after, target):

with pytest.raises(ValueError):
combine(target, [FileInfo("test_list.msg", "no_name")], "a")
with pytest.raises(ValueError):
combine(
target,
[FileInfo("test_list.msg", "no_name"), FileInfo("test_list.msg", "no_name")],
)
with pytest.raises(ValueError):
combine(target, [FileInfo("test_list.msg", "no_name")])
combine(target, [FileInfo("test_list.msg")], "a")


def test_recursive_combine(tmpdir):
Expand Down

0 comments on commit 5f1c9f5

Please sign in to comment.