ApprovalTests.Python
ApprovalTests.Python copied to clipboard
tests/integrations/pytest/test_namer.py fails if cloned to a different directory name
To Reproduce:
git clone https://github.com/approvals/ApprovalTests.Python foo
cd foo
./run_tests.sh
Result:
test_received_filename fails
Yup. Fails for me, too.
Even after I s/python/python3/ in ./run_tests.sh.
The problem is here: https://github.com/approvals/ApprovalTests.Python/blob/main/tests/integrations/pytest/test_namer.py#L14 (and a few lines down) which hard-code the name of the directory.
If it helps... git rev-parse --show-toplevel returns the absolute path of the project root, either
- /Users/michael/repos/ApprovalTests.Python or
- /Users/michael/repos/foo
That could be used in various ways with dirname, basename to pass relative paths.