Skip to content

Commit

Permalink
__version__ = "0.7.0"
Browse files Browse the repository at this point in the history
  • Loading branch information
lleites committed Jun 17, 2022
1 parent 7e30a85 commit fa7072e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 25 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
__pycache__/
/.coverage
venv/
*.egg-info/
*.egg-info/
.venv/
.vscode/
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "topyn"
version = "0.7.0.dev"
version = "0.7.0"
description = "TOPyN: Typed Opinionated PYthon Normalizer"
authors = ["Leandro Leites Barrios <[email protected]>"]
license = "MIT"
Expand Down
29 changes: 7 additions & 22 deletions tests/test_topyn.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


def test_version() -> None:
assert __version__ == "0.7.0.dev"
assert __version__ == "0.7.0"


def _run_system_exit(path: str) -> None:
Expand Down Expand Up @@ -57,10 +57,7 @@ def test_incorrect_naming(capsys: CaptureFixture) -> None:

mock_out.assert_called_with("rules")
captured = capsys.readouterr()
assert (
"N802 function name 'iLikeCamelCase' should be lowercase"
in captured.out
)
assert "N802 function name 'iLikeCamelCase' should be lowercase" in captured.out


def test_bugbear(capsys: CaptureFixture) -> None:
Expand All @@ -71,10 +68,7 @@ def test_bugbear(capsys: CaptureFixture) -> None:

mock_out.assert_called_with("rules")
captured = capsys.readouterr()
assert (
"B006 Do not use mutable data structures for argument defaults"
in captured.out
)
assert "B006 Do not use mutable data structures for argument defaults" in captured.out


def test_comprehensions(capsys: CaptureFixture) -> None:
Expand Down Expand Up @@ -102,15 +96,10 @@ def test_wrong_formatting(capsys: CaptureFixture) -> None:
def test_ok(capsys: CaptureFixture) -> None:
import topyn.tui

with patch.object(
topyn.tui, "everything_is_ok", wraps=topyn.tui.everything_is_ok
) as mock_out:
with patch.object(topyn.tui, "everything_is_ok", wraps=topyn.tui.everything_is_ok) as mock_out:
run(["tests/resources/ok"])
mock_out.assert_called_once()
assert (
"All done! ✨ 🍰 ✨\n1 file would be left unchanged.\n"
== capsys.readouterr().err
)
assert "All done! ✨ 🍰 ✨\n1 file would be left unchanged.\n" == capsys.readouterr().err


def test_fix(tmpdir: py.path.local) -> None:
Expand All @@ -123,9 +112,7 @@ def test_fix(tmpdir: py.path.local) -> None:
_run_system_exit(str(tmpdir))
mock_out.assert_called_with("formatting")

with patch.object(
topyn.tui, "trying_to_fix", wraps=topyn.tui.trying_to_fix
) as mock_out:
with patch.object(topyn.tui, "trying_to_fix", wraps=topyn.tui.trying_to_fix) as mock_out:
run([str(tmpdir), "--fix"])
mock_out.assert_called_once()

Expand All @@ -144,9 +131,7 @@ def test_fix_rules(tmpdir: py.path.local) -> None:
_run_system_exit(str(tmpdir))
mock_out.assert_called_with("rules")

with patch.object(
topyn.tui, "trying_to_fix", wraps=topyn.tui.trying_to_fix
) as mock_out:
with patch.object(topyn.tui, "trying_to_fix", wraps=topyn.tui.trying_to_fix) as mock_out:
run([str(tmpdir), "--fix"])
mock_out.assert_called_once()

Expand Down
2 changes: 1 addition & 1 deletion topyn/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.7.0.dev"
__version__ = "0.7.0"

0 comments on commit fa7072e

Please sign in to comment.