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

python setup.py nosetests fails with gusto #10

Closed
mcepl opened this issue Jul 9, 2012 · 5 comments · Fixed by #18
Closed

python setup.py nosetests fails with gusto #10

mcepl opened this issue Jul 9, 2012 · 5 comments · Fixed by #18
Labels

Comments

@mcepl
Copy link
Contributor

mcepl commented Jul 9, 2012

wycliff:appdirs-1.2.0 $ python setup.py nosetests
running nosetests
running egg_info
writing lib/appdirs.egg-info/PKG-INFO
writing top-level names to lib/appdirs.egg-info/top_level.txt
writing dependency_links to lib/appdirs.egg-info/dependency_links.txt
reading manifest file 'lib/appdirs.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'lib/appdirs.egg-info/SOURCES.txt'
running build_ext
E.EEEEEEE
======================================================================
ERROR: test_api (test_appdirs.DocTestsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/matej/build/BUILD/appdirs-1.2.0/test/test_appdirs.py", line 18, in test_api
    test = doctest.DocFileTest("api.doctests")
  File "/usr/lib64/python2.7/doctest.py", line 2424, in DocFileTest
    doc, path = _load_testfile(path, package, module_relative)
  File "/usr/lib64/python2.7/doctest.py", line 219, in _load_testfile
    with open(filename) as f:
IOError: [Errno 2] No such file or directory: '/home/matej/build/BUILD/appdirs-1.2.0/test/api.doctests'

======================================================================
ERROR: Failure: TypeError (testmod_paths_from_testdir() takes exactly 1 argument (0 given))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nose/loader.py", line 231, in generate
    for test in g():
TypeError: testmod_paths_from_testdir() takes exactly 1 argument (0 given)

======================================================================
ERROR: Failure: TypeError (testmods_from_testdir() takes exactly 1 argument (0 given))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nose/loader.py", line 231, in generate
    for test in g():
TypeError: testmods_from_testdir() takes exactly 1 argument (0 given)

======================================================================
ERROR: Failure: TypeError (testcases_from_testmod() takes exactly 1 argument (0 given))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nose/loader.py", line 231, in generate
    for test in g():
TypeError: testcases_from_testmod() takes exactly 1 argument (0 given)

======================================================================
ERROR: Failure: TypeError (tests_from_manifest() takes exactly 1 argument (0 given))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nose/loader.py", line 231, in generate
    for test in g():
TypeError: tests_from_manifest() takes exactly 1 argument (0 given)

======================================================================
ERROR: Failure: TypeError (tests_from_manifest_and_tags() takes exactly 2 arguments (0 given))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nose/loader.py", line 231, in generate
    for test in g():
TypeError: tests_from_manifest_and_tags() takes exactly 2 arguments (0 given)

======================================================================
ERROR: testlib.test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
TypeError: test() takes at least 1 argument (0 given)

======================================================================
ERROR: testlib.list_tests
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
TypeError: list_tests() takes exactly 2 arguments (0 given)

----------------------------------------------------------------------
Ran 9 tests in 0.076s

FAILED (errors=8)
wycliff:appdirs-1.2.0 $ 
@srid
Copy link
Contributor

srid commented Mar 18, 2013

appdirs uses an old home-grown test library -- written by @trentm i believe before the modern python testing tools came into existence -- to run its tests. if anyone wants to port the tests to nose, feel free to do it.

@srid srid closed this as completed Mar 18, 2013
@mcepl
Copy link
Contributor Author

mcepl commented Mar 18, 2013

I would just say ... don’t port to nose, use stdlib and unittest, it is good enough these days.

@eddyp
Copy link
Contributor

eddyp commented Mar 18, 2013

I would recommend py.test as a test framework.
It requires a lot less boiler plate code than unittest or other frameworks. It can transparently integrate code coverage and doctest tests.

@mcepl
Copy link
Contributor Author

mcepl commented Mar 18, 2013

  1. “a lot less boiler plate” … what are you talking about? Show me, what’s wrong with my pull request.
  2. I start to thinking about non-standard libraries in the moment (and not sooner) the standard ones are too cumbersome to use. Tell me, what of the 10 (in words: ten) trivial test cases is too complicated for unittest?
  3. Also, standard objections to using non-standard libraries … who will maintain compatibility with older/more recent versions of the standard Python?

@eddyp
Copy link
Contributor

eddyp commented Mar 18, 2013

@mcepl: I think you might have taken my suggestion the wrong way. I wasn't making any statement regarding the quality of your code, I was pointing out that, generally, py.test requires a lot less boilerplate code and has some other advantages that could be useful for appdirs.

Regarding your concern about backward compatibility, py.test is quite well maintained and has as an explicit goal to be compatible with all versions of python that make sense without requiring the user to account for them.

I, by no means, wanted to critique your work or something of that sort, but I was simply trying to give some input, in the hope it would be helpful.

If the maintainers of appdirs conclude any of our ideas and code are of any value, they will probably integrate them.

BTW, I made myself some changes which relate to XDG compliance and was wondering how difficult would it be to test the actual behaviour for all supported platforms on any arbitrary platform?
I suppose that must involve some mock objects to correctly give appdirs the right environment to assume native execution, is that feasible in the current implementation ?

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

Successfully merging a pull request may close this issue.

3 participants