Skip to content

Commit

Permalink
Remove nose (thank you)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolze committed Jan 4, 2021
1 parent 4d838ac commit 9c4d50f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 18 deletions.
6 changes: 0 additions & 6 deletions .noserc

This file was deleted.

3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ before_install:
install:
- poetry install
script:
- poetry run nosetests -c .noserc
- poetry run pytest -v ./tests
- poetry run coverage run -m pytest -v
after_success:
- codecov
deploy:
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,12 @@ PRs are welcome!

## Tests

Tests can be run in various ways:
With coverage and pytest:

* `python -m nose -c .noserc`
* `nosetests -c .noserc`
* `python -m unittest discover`
* `python setup.py test`
* `./tests/test_cli.sh`
```
poetry install
poetry run coverage run -m pytest -v
```

If the [cryptography](https://pypi.org/project/cryptography/) package is not installed, tests are skipped. If you have dependencies installed only for a certain python version, replace "python" with "pythonX.Y" in the above commands.

Expand Down
3 changes: 1 addition & 2 deletions msoffcrypto/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ def is_encrypted(file):
Test if the file is encrypted.
>>> f = open("tests/inputs/plain.doc", "rb")
>>> file = OfficeFile(f)
>>> is_encrypted(file)
>>> is_encrypted(f)
False
"""
# TODO: Validate file
Expand Down
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ cryptography = ">=2.3"
olefile = ">=0.45"

[tool.poetry.dev-dependencies]
nose = ">=1.3.7"
coverage = ">=4.5.1"
pytest = [{ version = ">=6.2.1", python = "^3.6" }, { version = "^4.6.11", python = "^2.7" }]
black = { version = "^20.8b1", python = "^3.6" }
coverage = { extras = ["toml"], version = "^5.3.1" }

[tool.poetry.scripts]
msoffcrypto-tool = 'msoffcrypto.__main__:main'
Expand All @@ -26,6 +25,13 @@ msoffcrypto-tool = 'msoffcrypto.__main__:main'
line-length = 140
exclude = '/(\.git|\.pytest_cache|\.venv|\.vscode|dist|docs)/'

[tool.pytest.ini_options]
addopts = "-ra -q --doctest-modules"
testpaths = ["msoffcrypto", "tests"]

[tool.coverage.run]
omit = [".venv/*", "tests/*"]

[build-system]
requires = ["poetry_core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 9c4d50f

Please sign in to comment.