Skip to content

Commit

Permalink
chore: introduce pytest instead of unittest (#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
kitagry authored Sep 17, 2024
1 parent 8b62c64 commit b115c18
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 3 deletions.
2 changes: 2 additions & 0 deletions luigi.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[core]
autoload_range: false
75 changes: 74 additions & 1 deletion poetry.lock

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

17 changes: 17 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ mypy = "*"
types-redis = "*"
matplotlib = "*"
typing-extensions = "^4.11.0"
pytest = "*"
pytest-cov = "*"

[tool.ruff]
line-length = 160
Expand Down Expand Up @@ -72,3 +74,18 @@ check_untyped_defs = true
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.pytest.ini_options]
testpaths = ["test"]
addopts = "-s -v --durations=0"

[tool.coverage.run]
branch = true
source = ["gokart"]
command_line = "-m pytest"

[tool.coverage.report]
show_missing = true

[tool.coverage.xml]
output = "coverage.xml"
2 changes: 1 addition & 1 deletion test/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def run(self):

class TestBuildHasLockedTaskException(unittest.TestCase):
def test_build_expo_backoff_when_luigi_failed_due_to_locked_task(self):
gokart.build(_FailThreeTimesAndSuccessTask(), reset_register=False, log_level=logging.INFO)
gokart.build(_FailThreeTimesAndSuccessTask(), reset_register=False)


if __name__ == '__main__':
Expand Down
5 changes: 4 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ isolated_build = true
[testenv]
allowlist_externals = coverage
skip_install = true
commands = coverage run -m unittest discover -s test
commands =
coverage run
coverage xml
coverage report

[testenv:ruff]
allowlist_externals = ruff
Expand Down

0 comments on commit b115c18

Please sign in to comment.