You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nosetests will try to run any python modules labeled *test* that are in the current directory or any subdirectories. You can also give it an explicit test module e.g. nosetests pvlib/tests/test_tmy.py. That being said, I don't have any objection to adding a test.sh similar to the one in pandas.
There are certainly a lot of tests that could be made cleaner with class based testing and setUp methods.
I use the same versions. However I'm on linux 64bit, maybe something goes wrong here. Still couldn't figure out, what the problem is, but will have time on Friday to check this.
I solved my problem (The reason was, that I was trying to test pvlib on a NTFS drive on my new machine, which was mounted so that the files were executable and nosetests skippes files, that are executable!).
@wholmgren: Do you think it makes sence, that I open a pull request that changes the unit tests to "real" unittests test now, or is this something for a later release? I could also create the milestones (see #11) first.
There are definitely problems with the existing test modules that classes traditionally fix:
The set up code is run once at the beginning of the module and reused for all tests
The set up code is executed when the module is imported since it's not protected by a class or if __name__ == '__main__' statement
I used copy/paste/modify to write many functions
I'll take most (all?) of the blame for the fast and easy but unsustainable pattern. Some of the tests, particularly those that use solar position, will probably need to be made faster if the set up is executed multiple times.
Do you want to remove the nose dependency for development or just clean up the copy/paste mess?
I'm reluctant to support a rule along the lines of "all tests must be in classes that inherit from pandas TestCase or unittest.TestCase". I would prefer to use test classes where they will clearly improve the code, and leave functions where they will not. I also think that less experienced python developers will have an easier time making tests if they only need to be functions that are named "test_*".
In any case, I suggest that any test suite overhaul be done after the 0.1 release.
My intention to move to Pandas TestCases is not to have "nicer code" or that we use classes without a need to.
The reason is, that these test cases really test a series or a DataFrame: they test for expected values and for the expected index.
This is especially useful because often time series are used as input for pvlib functions. My experience from everyday work with functions (not classes;-) that use Pandas and numpy is, that the preservation of Datetime indexes is sometimes a difficulty and can lead to unexpected results, that are not easy to detect.
Also for unexperienced programmers it may be usefull to have something like a template for testing, which could be provided by an existing test.
No Problem with skipping this for now, but I think these Tests are really useful for future releases.
That all makes sense. Good point regarding the templates too.
On Sun, Mar 8, 2015 at 11:08 PM bmu notifications@github.com wrote:
My intention to move to Pandas TestCases is not to have "nicer code" or
that we use classes without a need to.
The reason is, that these test cases really test a series or a DataFrame:
they test for expected values and for the expected index.
This is especially useful because often time series are used as input for
pvlib functions. My experience from everyday work with functions (not
classes;-) that use Pandas and numpy is, that the preservation of Datetime
indexes is sometimes a difficulty and can lead to unexpected results, that
are not easy to detect.
Also for unexperienced programmers it may be usefull to have something
like a template for testing, which could be provided by an existing test.
No Problem with skipping this for now, but I think these Tests are really
useful for future releases.
—
Reply to this email directly or view it on GitHub #12 (comment).
A couple of things related to the stalled conversation above...
The nose documentation is now warning people that it's no longer in active development and recommends that new projects use pytest or just unittest. I've not used pytest, but it looks nice.
I added a bunch of assert_series_equal and assert_frame_equal statements to the test code, so I think that this covers most of @bmu's concerns in his last comment and I wonder if this issue can be closed.
A couple of things related to the stalled conversation above...
The nose documentation is now warning people that it's no longer in
active development and recommends that new projects use pytest or just
unittest. I've not used pytest, but it looks nice.
I added a bunch of assert_series_equal and assert_frame_equal
statements to the test code, so I think that this covers most of @bmu's
concerns in his last comment
and I wonder if this issue can be closed.
Reply to this email directly or view it on GitHub: #12 (comment)
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
Activity
wholmgren commentedon Mar 2, 2015
nosetestswill try to run any python modules labeled*test*that are in the current directory or any subdirectories. You can also give it an explicit test module e.g.nosetests pvlib/tests/test_tmy.py. That being said, I don't have any objection to adding atest.shsimilar to the one inpandas.There are certainly a lot of tests that could be made cleaner with class based testing and setUp methods.
bmu commentedon Mar 2, 2015
Yes, it should, however if I run it in my local repository from the base folder (where
setup.pyis located) the output ofnosetestsisNot sure whats going on here, as the coverage seems to work:
wholmgren commentedon Mar 2, 2015
Strange. I ran that exact command from the same directory and it worked as expected.
robwandrews commentedon Mar 3, 2015
In some cases you need to enable the --exe option for it to work . That being said the following worked for me:
in the pvlib-python directory
bmu commentedon Mar 4, 2015
I use the same versions. However I'm on linux 64bit, maybe something goes wrong here. Still couldn't figure out, what the problem is, but will have time on Friday to check this.
dacoex commentedon Mar 4, 2015
@bmu
take a look at this:
https://launchpad.net/~pythonxy/+archive/ubuntu/pythonxy-devel
may ease up your updating with auto built daily packages.
bmu commentedon Mar 8, 2015
I solved my problem (The reason was, that I was trying to test pvlib on a NTFS drive on my new machine, which was mounted so that the files were executable and nosetests skippes files, that are executable!).
@wholmgren: Do you think it makes sence, that I open a pull request that changes the unit tests to "real" unittests test now, or is this something for a later release? I could also create the milestones (see #11) first.
wholmgren commentedon Mar 8, 2015
There are definitely problems with the existing test modules that classes traditionally fix:
if __name__ == '__main__'statementI'll take most (all?) of the blame for the fast and easy but unsustainable pattern. Some of the tests, particularly those that use solar position, will probably need to be made faster if the set up is executed multiple times.
Do you want to remove the nose dependency for development or just clean up the copy/paste mess?
I'm reluctant to support a rule along the lines of "all tests must be in classes that inherit from pandas
TestCaseorunittest.TestCase". I would prefer to use test classes where they will clearly improve the code, and leave functions where they will not. I also think that less experienced python developers will have an easier time making tests if they only need to be functions that are named "test_*".In any case, I suggest that any test suite overhaul be done after the
0.1release.bmu commentedon Mar 9, 2015
My intention to move to Pandas TestCases is not to have "nicer code" or that we use classes without a need to.
The reason is, that these test cases really test a series or a DataFrame: they test for expected values and for the expected index.
This is especially useful because often time series are used as input for pvlib functions. My experience from everyday work with functions (not classes;-) that use Pandas and numpy is, that the preservation of Datetime indexes is sometimes a difficulty and can lead to unexpected results, that are not easy to detect.
Also for unexperienced programmers it may be usefull to have something like a template for testing, which could be provided by an existing test.
No Problem with skipping this for now, but I think these Tests are really useful for future releases.
wholmgren commentedon Mar 9, 2015
That all makes sense. Good point regarding the templates too.
On Sun, Mar 8, 2015 at 11:08 PM bmu notifications@github.com wrote:
wholmgren commentedon Feb 2, 2016
A couple of things related to the stalled conversation above...
The nose documentation is now warning people that it's no longer in active development and recommends that new projects use pytest or just unittest. I've not used pytest, but it looks nice.
I added a bunch of
assert_series_equalandassert_frame_equalstatements to the test code, so I think that this covers most of @bmu's concerns in his last comment and I wonder if this issue can be closed.bmu commentedon Feb 2, 2016
So feel free to close it!
Am 2. Februar 2016 01:06:26 MEZ, schrieb Will Holmgren notifications@github.com:
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
wholmgren commentedon Feb 2, 2016
thanks @bmu, closing.