Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup and refactor tests #251

Merged
merged 25 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
44ac34f
tests: Add config tests subclasses
JonathonReinhart Mar 24, 2024
67f5efc
tests: Add main tests subclasses
JonathonReinhart Mar 24, 2024
9baf0e6
tests: Require expect_return as keyword-only
JonathonReinhart Mar 24, 2024
fcf2c09
tests: Move run_scuba out of MainTest
JonathonReinhart Mar 24, 2024
3f12a7c
tests: Use monkeypatch.setenv() instead of actual env manipulation
JonathonReinhart Mar 24, 2024
22f3500
tests: Consistently write .scuba.yml using Path.write_text()
JonathonReinhart Mar 24, 2024
7eb95e9
tests: Consistently use Path.write_text() in test_config.py
JonathonReinhart Mar 24, 2024
8e2d598
tests: Move ConfigTest._invalid_config() to free function
JonathonReinhart Mar 24, 2024
637d085
tests: Pass config text to load_config() and invalid_config()
JonathonReinhart Mar 24, 2024
50b8676
tests: Use Path.write_text() in remaining cases in tests_config.py
JonathonReinhart Mar 24, 2024
653a604
tests: Add missing PseudoTTY import
JonathonReinhart Mar 25, 2024
035f275
tests: Add write_script() helper in test_main.py
JonathonReinhart Mar 25, 2024
aecba5f
tests: Use write_script() in TestMainBasic::test_args
JonathonReinhart Mar 25, 2024
51c98e4
tests: Use write_script() in TestMainStdinStdout
JonathonReinhart Mar 25, 2024
35f1ec4
tests: Use Path.write_text() in TestMainAliasScripts
JonathonReinhart Mar 25, 2024
2831357
tests: Use write_script() in TestMainEntrypoint
JonathonReinhart Mar 25, 2024
27f2f72
tests: Remove unnecessary "coding=utf-8" declaration
JonathonReinhart Mar 25, 2024
602366f
tests: Enable typing in test_utils.py
JonathonReinhart Mar 25, 2024
2ccf671
tests: Improve typing in test_config.py
JonathonReinhart Mar 25, 2024
2f5c406
tests: Add type annotations in utils.py
JonathonReinhart Mar 25, 2024
3635f87
tests: Improve typing in test_main.py
JonathonReinhart Mar 25, 2024
dc7b8e7
tests: Ignore untyped mock.patch(side_effect=) functions
JonathonReinhart Mar 25, 2024
7d4de93
mypy: Disallow untyped/incomplete defs in all Python code
JonathonReinhart Mar 25, 2024
e656eb4
tests: Correct inappropriate all caps local vars
JonathonReinhart Mar 25, 2024
fe16200
tests: Simplify TestFindConfig with use of Path
JonathonReinhart Mar 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ requires = [
packages = ["scuba", "tests"]
warn_unused_configs = true
warn_return_any = true

[[tool.mypy.overrides]]
module = "scuba.*"
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from pathlib import Path
import pytest


@pytest.fixture
def in_tmp_path(tmp_path, monkeypatch):
def in_tmp_path(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path:
"""Runs a test in a temporary directory provided by the tmp_path fixture"""
monkeypatch.chdir(tmp_path)
return tmp_path
Loading
Loading