Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions checks/pathlib/pathlib1.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
from pathlib import Path

assert path == Path("notes/today.txt")
assert filename == "today.txt"
assert path == Path("notes/today.txt"), (
f"path should be Path('notes/today.txt'), got {path!r}"
)
assert filename == "today.txt", (
f"filename should be 'today.txt', got {filename!r}"
)
print("pathlib1 ok")
4 changes: 3 additions & 1 deletion checks/pathlib/pathlib2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from pathlib import Path

assert source == Path("pythonlings/src/main.py")
assert source == Path("pythonlings/src/main.py"), (
f"source should be Path('pythonlings/src/main.py'), got {source!r}"
)
print("pathlib2 ok")
8 changes: 5 additions & 3 deletions checks/pathlib/pathlib3.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from pathlib import Path

assert parent == Path("docs")
assert stem == "guide"
assert suffix == ".md"
assert parent == Path("docs"), (
f"parent should be Path('docs'), got {parent!r}"
)
assert stem == "guide", f"stem should be 'guide', got {stem!r}"
assert suffix == ".md", f"suffix should be '.md', got {suffix!r}"
print("pathlib3 ok")
5 changes: 4 additions & 1 deletion checks/pathlib/pathlib4.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from pathlib import Path

assert python_files == [Path("app.py"), Path("tests.py")]
assert python_files == [Path("app.py"), Path("tests.py")], (
f"python_files should be [Path('app.py'), Path('tests.py')], "
f"got {python_files!r}"
)
print("pathlib4 ok")
4 changes: 3 additions & 1 deletion checks/pathlib/pathlib5.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from pathlib import Path

assert final == Path("reports/final.txt")
assert final == Path("reports/final.txt"), (
f"final should be Path('reports/final.txt'), got {final!r}"
)
print("pathlib5 ok")
8 changes: 6 additions & 2 deletions checks/pathlib/pathlib6.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
from pathlib import Path

assert processed == Path("data/raw.json")
assert parts[-2:] == ("data", "raw.json")
assert processed == Path("data/raw.json"), (
f"processed should be Path('data/raw.json'), got {processed!r}"
)
assert parts[-2:] == ("data", "raw.json"), (
f"parts[-2:] should be ('data', 'raw.json'), got {parts[-2:]!r}"
)
print("pathlib6 ok")
Loading