Skip to content

Instantly share code, notes, and snippets.

@jurko-gospodnetic
Last active January 4, 2016 02:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jurko-gospodnetic/8557690 to your computer and use it in GitHub Desktop.
Save jurko-gospodnetic/8557690 to your computer and use it in GitHub Desktop.
Discussion on what specific py.test invocations should do.
Folder hierarchy:
-----------------
project-X/ # project folder, e.g. checkout from version control
setup.cfg
build/ # created by setup.py build
lib/
code/
test_file.py
more-code/
even-more-code/
test_dirty.py
tests/
tests/
resources/
incorrectly-named-tests/
code/
test_file.py
more-code/
even-more-code/
test_dirty.py
tests/
tests/
resources/
incorrectly-named-tests/
site-packages/
x/ # installed package
code/
test_file.py
more-code/
even-more-code/
test_dirty.py
tests/
tests/
resources/
incorrectly-named-tests/
py.test invocations:
--------------------
Not sure about the following for each of these runs:
- where they find their pytest configuration file
- where they consider their 'project root' is, i.e. what path gets added to
python path when they actually run their tests
- what folders are scanned for conftest.py files on startup, i.e. before
displaying --help output
- what folders are scanned for conftest.py files just before running actual
tests, i.e. after it has been decided that this run should not just display
--help output and exit
1. py.test # called from project-X/
2. py.test # called from site-packages/x/
3. py.test # called from project-X/build
4. py.test # called from project-X/code/
5. py.test # called from project-X/more-code/
6. py.test # called from project-X/tests/
7. py.test tests # called from project-X/
8. py.test build # called from project-X/
9. py.test build/lib # called from project-X/
10. py.test ...full-path.../project-X/build # from some unrelated folder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment