Skip to content

Commit

Permalink
Update CI (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbruno25 authored Sep 11, 2023
1 parent fac7b53 commit e667448
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 30 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry tox tox-gh-actions
- name: Test with tox
run: tox
python -m pip install poetry
poetry install
- name: Format
run: poetry run black .
- name: Lint
run: poetry run ruff check .
- name: Test
run: poetry run pytest -v
- name: Type
run: poetry run mypy .

27 changes: 2 additions & 25 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,5 @@ timestamps = "pytest_timestamps.plugin"
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.tox]
legacy_tox_ini = """
[tox]
isolated_build = true
env_list =
py37
py38
py39
py310
[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
[testenv]
allowlist_externals =
poetry
commands =
poetry install --only dev
poetry run pytest -v
"""
[tool.ruff]
select = ["A", "B", "E", "F", "I", "UP"]
4 changes: 2 additions & 2 deletions pytest_timestamps/timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from _pytest.reports import TestReport


def format(timestamp: float) -> str:
def _format(timestamp: float) -> str:
return datetime.fromtimestamp(timestamp).strftime("%H:%M:%S")


Expand All @@ -21,7 +21,7 @@ def _format(timestamp: float) -> str:
return datetime.fromtimestamp(timestamp).strftime("%H:%M:%S")

def get(self) -> str:
return f"[{format(self.start)} - {format(self.stop)}]" # type: ignore
return f"[{_format(self.start)} - {_format(self.stop)}]" # type: ignore

def is_valid(self) -> bool:
return bool(self.start and self.stop)
Expand Down

0 comments on commit e667448

Please sign in to comment.