-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
move tests to tests folder #211
Closed
Closed
Changes from 5 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
aab68cf
remove 1to2 and depreciations
andrewgsavage da08ae9
move tests to tests folder
andrewgsavage 45b6057
move tests folder
andrewgsavage 9cb8085
move things around to get tests running
andrewgsavage 88364a7
remove refences to nose
andrewgsavage 8f904f3
add tests to pyproject.toml
andrewgsavage 97cbdf4
move power tests to helpers
andrewgsavage 8421268
remove 1to2 and deprecations (#214)
andrewgsavage f69d5fc
importlib
andrewgsavage 57e2a20
Removed unused imported modules from tests. (#210)
willynilly d48d1ec
Merge branch 'tests' of https://github.com/andrewgsavage/uncertaintie…
andrewgsavage a58a7e7
importlib
andrewgsavage 7a92f05
add tests.helpers to path
andrewgsavage 4b7ab86
add tests.helpers to path
andrewgsavage 04070e7
revert importlib
andrewgsavage a6fe054
revert importlib
andrewgsavage 925f74a
empty umat
andrewgsavage File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not seem right to import from one
test_
file to another. These functions do seem too specialized foruncertainties.testing
though. Could we use one of the options in this StackOverflow question. Maybe theconftest.py
and fixture option, or thepythonpath
and helpers file option?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding
testpaths = ["tests"]
is not required for tests to work right? It's just a convenience that makespytest
discover tests more quickly? Is my understanding correct?In the past I've put helper function needed for testing in an
__init__.py
file in thetests
folder. These objects can then be imported within the test scripts. We could also have atests/helper.py
module to accomplish the same result.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, importing across test files does feel a bit odd. The helpers.py solution is nice and simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that seems to be all it does functionally. My conjecture was that it might also help IDE's figure out that the project uses pytest as the test runner because otherwise there is no configuration indicating that pytest should be run, but I haven't tried to confirm that.
I like the move to helpers.py. We might want to add
to pyproject.toml like the one StackOverflow answer suggests, but we could wait for that. Currently, pytest adds all the test directories to the Python path so you can do
import helpers
but it has been trying to move away from that to just importing the test files withimportlib
without modifying the Python path.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for explaining, wouldn't have understood why otherwise