Skip to content

Commit feb8af8

Browse files
authored
Merge pull request #22 from FontysVenlo/do-not-remove-output-dir
Do not remove output dir
2 parents 2789891 + f343d6b commit feb8af8

4 files changed

Lines changed: 20 additions & 15 deletions

File tree

codestripper/code_stripper.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ def strip_files(files: Iterable[str], working_directory: Union[str, None] = None
2929

3030
cwd = get_working_directory(working_directory)
3131
out = os.path.join(os.getcwd(), output)
32-
if os.path.isdir(out):
33-
shutil.rmtree(out)
32+
3433
stripped_files: List[str] = []
3534
has_errors: bool = False
3635
for file in files:

poetry.lock

Lines changed: 18 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "codestripper"
3-
version = "1.1.2"
3+
version = "1.2.0"
44
description = "CodeStripper used to strip code from assignments"
55
authors = ["Bonajo <m.bonajo@fontys.nl>"]
66
maintainers = ["Bonajo <m.bonajo@fontys.nl>"]

tests/test_codestripper.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,6 @@ def test_log_invalid_tag(monkeypatch: pytest.MonkeyPatch, caplog: LogCaptureFixt
128128
assert len(errors) == 1 and "InvalidTag.java" in errors[0] and "2" in errors[0]
129129

130130

131-
def test_project_out_removes(monkeypatch: pytest.MonkeyPatch):
132-
monkeypatch.chdir(test_project_dir)
133-
files = FileUtils(["**/*.java", "pom.xml"], working_directory="testproject").get_matching_files()
134-
strip_files(files, "testproject", output="out")
135-
files = FileUtils(["pom.xml"], working_directory="testproject").get_matching_files()
136-
strip_files(files, "testproject", output="out")
137-
assert not os.path.isdir(Path("out/src"))
138-
139-
140131
def test_fail_on_error(monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture):
141132
monkeypatch.chdir(test_project_dir)
142133
files = FileUtils(["**/*.java"], working_directory="files").get_matching_files()

0 commit comments

Comments
 (0)