diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9f15674..d6817c21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,4 +72,4 @@ jobs: flit install --extras=all - uses: jakebailey/pyright-action@v1 with: - working-directory: src + working-directory: . diff --git a/test/integration/test_archiver.py b/test/integration/test_archiver.py index 9c6e9274..693c5a72 100644 --- a/test/integration/test_archiver.py +++ b/test/integration/test_archiver.py @@ -56,7 +56,7 @@ def test_git_end_to_end(tmpdir): and revisions[1].key not in commit2.name_rev ) - checkout = archiver.checkout(revisions[1], None) + checkout = archiver.checkout(revisions[1], {}) assert not (tmppath / "test.py").exists() diff --git a/test/integration/test_build.py b/test/integration/test_build.py index 5c1cd564..84e544e1 100644 --- a/test/integration/test_build.py +++ b/test/integration/test_build.py @@ -164,7 +164,7 @@ def test_build_with_config(tmpdir, cache_path): [ "--debug", "--config", - config_path, + str(config_path), "--path", tmpdir, "--cache", diff --git a/test/integration/test_report.py b/test/integration/test_report.py index 082ca4d8..2a1f9c57 100644 --- a/test/integration/test_report.py +++ b/test/integration/test_report.py @@ -44,7 +44,7 @@ def test_report_granular(builddir): "cyclomatic.complexity", "--message", "-n", - 1, + "1", ], ) assert result.exit_code == 0, result.stdout @@ -104,7 +104,7 @@ def test_report_with_message_and_n(builddir): runner = CliRunner() result = runner.invoke( main.cli, - ["--path", builddir, "report", _path, "raw.multi", "--message", "-n", 1], + ["--path", builddir, "report", _path, "raw.multi", "--message", "-n", "1"], ) assert result.exit_code == 0, result.stdout assert "basic test" not in result.stdout diff --git a/test/unit/test_archivers.py b/test/unit/test_archivers.py index b3b1875b..22894332 100644 --- a/test/unit/test_archivers.py +++ b/test/unit/test_archivers.py @@ -43,6 +43,8 @@ class MockRepo: _is_dirty = False commits = [MockCommit("commit-1"), MockCommit("commit-2")] head = MockHead() + path: pathlib.Path + git: "MockGit" def is_dirty(self): return self._is_dirty @@ -76,7 +78,7 @@ def repo(tmpdir): def test_basearchiver(): - wily.archivers.BaseArchiver(None) + wily.archivers.BaseArchiver(wily.config.DEFAULT_CONFIG) def test_defaults(): diff --git a/test/unit/test_build_unit.py b/test/unit/test_build_unit.py index 757f03f9..ddd8fb86 100644 --- a/test/unit/test_build_unit.py +++ b/test/unit/test_build_unit.py @@ -75,12 +75,13 @@ def test_build_simple(config): with patch("wily.state.resolve_archiver", return_value=MockArchiver), patch( "wily.commands.build.resolve_operator", return_value=MockOperator ): - result = build.build(config, MockArchiver, _test_operators) + result = build.build(config, MockArchiver, _test_operators) # type: ignore assert result is None def test_run_operator(config): - name, data = build.run_operator(MockOperator, "123", config, ["test1.py"]) + rev = Revision("123", None, None, 1, "message", [], [], [], [], []) + name, data = build.run_operator(MockOperator, rev, config, ["test1.py"]) assert name == "mock" path = "C:\\home\\test1.py" if sys.platform == "win32" else "/home/test1.py" assert data == {os.path.relpath(path, config.path): None} diff --git a/test/unit/test_cache.py b/test/unit/test_cache.py index 2cb2b9ee..1f8c1472 100644 --- a/test/unit/test_cache.py +++ b/test/unit/test_cache.py @@ -106,7 +106,7 @@ def test_store_basic(tmpdir): key="12345", author_name="Anthony Shaw", author_email="anthony@test.com", - date="17/01/1990", + date=632545200, message="my changes", tracked_files=[target_path], tracked_dirs=[target_path], @@ -134,7 +134,7 @@ def test_store_twice(tmpdir): key="12345", author_name="Anthony Shaw", author_email="anthony@test.com", - date="17/01/1990", + date=632545200, message="my changes", tracked_files=[target_path], tracked_dirs=[target_path], @@ -162,7 +162,7 @@ def test_store_relative_paths(tmpdir): key="12345", author_name="Anthony Shaw", author_email="anthony@test.com", - date="17/01/1990", + date=632545200, message="my changes", tracked_files=[target_path], tracked_dirs=[target_path],