Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/integrations/pytest/test_namer.py fails if cloned to a different directory name #183

Open
JayBazuzi opened this issue Nov 4, 2024 · 3 comments

Comments

@JayBazuzi
Copy link
Contributor

JayBazuzi commented Nov 4, 2024

To Reproduce:

git clone https://github.com/approvals/ApprovalTests.Python foo
cd foo
./run_tests.sh

Result:

test_received_filename fails

@MichaelRWolf
Copy link
Contributor

Yup. Fails for me, too.

Even after I s/python/python3/ in ./run_tests.sh.

@JayBazuzi
Copy link
Contributor Author

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.

@MichaelRWolf
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants