-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for rust estimator parser matches pure python implementation
- Loading branch information
1 parent
2e4f3b4
commit 6218996
Showing
4 changed files
with
74 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
def pytest_sessionstart(session) -> None: | ||
"""Clear the test output of previous runs.""" | ||
import shutil | ||
from pathlib import Path | ||
|
||
import artistools as at | ||
|
||
outputpath = at.get_config()["path_testoutput"] | ||
outputpath = at.get_config("path_testoutput") | ||
assert isinstance(outputpath, Path) | ||
repopath = at.get_config("path_artistools_repository") | ||
assert isinstance(repopath, Path) | ||
if outputpath.exists(): | ||
is_descendant = repopath.resolve() in outputpath.resolve().parents | ||
assert ( | ||
is_descendant | ||
), f"Refusing to delete {outputpath.resolve()} as it is not a descendant of the repository {repopath.resolve()}" | ||
shutil.rmtree(outputpath) | ||
outputpath.mkdir(exist_ok=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters