Skip to content

Commit

Permalink
Merge pull request #72 from discord-modmail/minor-test-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivansh-007 authored Sep 2, 2021
2 parents 0a329ff + a545925 commit d7c41b6
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 160 deletions.
80 changes: 25 additions & 55 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 15 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ pytest = "^6.2.4"
pytest-asyncio = "^0.15.1"
pytest-cov = "^2.12.1"
pytest-dependency = "^0.5.1"
pytest-docs = "^0.1.0"
pytest-sugar = "^0.9.4"
pytest-xdist = { version = "^2.3.0", extras = ["psutil"] }
# Documentation
Expand All @@ -68,7 +67,7 @@ source_pkgs = ["modmail"]
omit = ["modmail/plugins/**.*"]

[tool.pytest.ini_options]
addopts = "--cov= "
addopts = "--cov --cov-report="
minversion = "6.0"
testpaths = ["tests"]

Expand All @@ -90,16 +89,21 @@ echo "Done exporting."
help = "Export installed packages in requirements.txt format"

[tool.taskipy.tasks]
black = { cmd = "black --check .", help = "dry run of black" }
codecov-validate = { cmd = "curl --data-binary @.codecov.yml https://codecov.io/validate", help = "Validate `.codecov.yml` with their api." }
pre_cov-server = "coverage html"
cov-server = { cmd = "python -m http.server 8012 --bind 127.0.0.1 --directory htmlcov", help = "Start an http.server for viewing coverage data."}
# Documentation
docs = { cmd = "mkdocs serve", help = "Run the docs on a local automatically reloading server"}

# Bot
start = { cmd = "python -m modmail", help = "Run bot" }

# Linting
precommit = { cmd = "pre-commit install --install-hooks", help = "Installs the precommit hook" }
black = { cmd = "black --check .", help = "dry run of black" }
flake8 = { cmd = "python -m flake8", help = "Lints code with flake8" }
lint = { cmd = "pre-commit run --all-files", help = "Checks all files for CI errors" }
precommit = { cmd = "pre-commit install --install-hooks", help = "Installs the precommit hook" }
pytest-docs = { cmd = "pytest --no-cov --co -qqq --docs tests/docs.md", help = "Create docs for tests using pytest-docs." }

# Testing
codecov-validate = { cmd = "curl --data-binary @.codecov.yml https://codecov.io/validate", help = "Validate `.codecov.yml` with their api." }
cov-server = { cmd = "coverage html", help = "Start an http.server for viewing coverage data."}
post-cov-server = "python -m http.server 8012 --bind 127.0.0.1 --directory htmlcov"
report = { cmd = "coverage report", help = "Show coverage report from previously run tests." }
start = { cmd = "python -m modmail", help = "Run bot" }
test = { cmd = "pytest -n auto --dist loadfile --cov-report= --cov= --docs tests/docs.md", help = "Runs tests and save results to a coverage report" }
test-nocov = { cmd = "pytest --no-cov", help = "Runs tests without creating a coverage report" }
test = { cmd = "pytest -n auto --dist loadfile", help = "Runs tests and save results to a coverage report" }
Loading

0 comments on commit d7c41b6

Please sign in to comment.