Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Some dumb tests and a fix #9

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Conversation

obiwanus
Copy link

@obiwanus obiwanus commented Feb 5, 2014

Added tests for py26, py27 and py32.
Fixed the calculation of rate in format_meter.

@noamraph
Copy link
Owner

noamraph commented Feb 5, 2014

Thanks for the impressive work!

I tried to run the tests and they failed. I don't know exactly why.

Here's the output:

> sudo pip install tox
...
noam@naaman:~/sand/tqdm$ tox
GLOB sdist-make: /home/noam/sand/tqdm/setup.py
py26 create: /home/noam/sand/tqdm/.tox/py26
ERROR: InterpreterNotFound: python2.6
py27 create: /home/noam/sand/tqdm/.tox/py27
py27 installdeps: pytest
py27 inst: /home/noam/sand/tqdm/.tox/dist/tqdm-1.0.zip
py27 runtests: PYTHONHASHSEED='2638455097'
py27 runtests: commands[0] | py.test
============================= test session starts ==============================
platform linux2 -- Python 2.7.3 -- py-1.4.20 -- pytest-2.5.2
collected 0 items / 1 errors 

==================================== ERRORS ====================================
______________________________ ERROR collecting . ______________________________
.tox/py27/local/lib/python2.7/site-packages/py/_path/common.py:327: in visit
>       for x in Visitor(fil, rec, ignore, bf, sort).gen(self):
.tox/py27/local/lib/python2.7/site-packages/py/_path/common.py:373: in gen
>               for p in self.gen(subdir):
.tox/py27/local/lib/python2.7/site-packages/py/_path/common.py:373: in gen
>               for p in self.gen(subdir):
.tox/py27/local/lib/python2.7/site-packages/py/_path/common.py:363: in gen
>                   if p.check(dir=1) and (rec is None or rec(p))])
.tox/py27/local/lib/python2.7/site-packages/_pytest/main.py:600: in _recurse
>       ihook.pytest_collect_directory(path=path, parent=self)
.tox/py27/local/lib/python2.7/site-packages/_pytest/main.py:161: in call_matching_hooks
>       plugins = self.config._getmatchingplugins(self.fspath)
.tox/py27/local/lib/python2.7/site-packages/_pytest/config.py:670: in _getmatchingplugins
>       plugins += self._conftest.getconftestmodules(fspath)
.tox/py27/local/lib/python2.7/site-packages/_pytest/config.py:512: in getconftestmodules
>                   clist.append(self.importconftest(conftestpath))
.tox/py27/local/lib/python2.7/site-packages/_pytest/config.py:538: in importconftest
>           self._conftestpath2mod[conftestpath] = mod = conftestpath.pyimport()
.tox/py27/local/lib/python2.7/site-packages/py/_path/local.py:620: in pyimport
>           __import__(modname)
build/tox/tests/conftest.py:2: in <module>
>   from tox._pytestplugin import *
E   ImportError: No module named tox._pytestplugin
=========================== 1 error in 0.12 seconds ============================
ERROR: InvocationError: '/home/noam/sand/tqdm/.tox/py27/bin/py.test'
py32 create: /home/noam/sand/tqdm/.tox/py32
py32 installdeps: pytest
py32 inst: /home/noam/sand/tqdm/.tox/dist/tqdm-1.0.zip
py32 runtests: PYTHONHASHSEED='2638455097'
py32 runtests: commands[0] | py.test
Traceback (most recent call last):
  File ".tox/py32/bin/py.test", line 9, in <module>
    load_entry_point('pytest==2.5.2', 'console_scripts', 'py.test')()
  File "/home/noam/sand/tqdm/.tox/py32/lib/python3.2/site-packages/_pytest/config.py", line 19, in main
    config = _prepareconfig(args, plugins)
  File "/home/noam/sand/tqdm/.tox/py32/lib/python3.2/site-packages/_pytest/config.py", line 63, in _prepareconfig
    pluginmanager=pluginmanager, args=args)
  File "/home/noam/sand/tqdm/.tox/py32/lib/python3.2/site-packages/_pytest/core.py", line 377, in __call__
    return self._docall(methods, kwargs)
  File "/home/noam/sand/tqdm/.tox/py32/lib/python3.2/site-packages/_pytest/core.py", line 388, in _docall
    res = mc.execute()
  File "/home/noam/sand/tqdm/.tox/py32/lib/python3.2/site-packages/_pytest/core.py", line 289, in execute
    res = method(**kwargs)
  File "/home/noam/sand/tqdm/.tox/py32/lib/python3.2/site-packages/_pytest/helpconfig.py", line 27, in pytest_cmdline_parse
    config = __multicall__.execute()
  File "/home/noam/sand/tqdm/.tox/py32/lib/python3.2/site-packages/_pytest/core.py", line 289, in execute
    res = method(**kwargs)
  File "/home/noam/sand/tqdm/.tox/py32/lib/python3.2/site-packages/_pytest/config.py", line 618, in pytest_cmdline_parse
    self.parse(args)
  File "/home/noam/sand/tqdm/.tox/py32/lib/python3.2/site-packages/_pytest/config.py", line 711, in parse
    self._preparse(args)
  File "/home/noam/sand/tqdm/.tox/py32/lib/python3.2/site-packages/_pytest/config.py", line 691, in _preparse
    args=args, parser=self._parser)
  File "/home/noam/sand/tqdm/.tox/py32/lib/python3.2/site-packages/_pytest/core.py", line 377, in __call__
    return self._docall(methods, kwargs)
  File "/home/noam/sand/tqdm/.tox/py32/lib/python3.2/site-packages/_pytest/core.py", line 388, in _docall
    res = mc.execute()
  File "/home/noam/sand/tqdm/.tox/py32/lib/python3.2/site-packages/_pytest/core.py", line 289, in execute
    res = method(**kwargs)
  File "/home/noam/sand/tqdm/.tox/py32/lib/python3.2/site-packages/_pytest/capture.py", line 55, in pytest_load_initial_conftests
    ns = parser.parse_known_args(args)
  File "/home/noam/sand/tqdm/.tox/py32/lib/python3.2/site-packages/_pytest/config.py", line 175, in parse_known_args
    return optparser.parse_known_args(args)[0]
  File "/home/noam/lib/python/argparse.py", line 1677, in parse_known_args
    if isinstance(action.default, basestring):
NameError: global name 'basestring' is not defined
ERROR: InvocationError: '/home/noam/sand/tqdm/.tox/py32/bin/py.test'
___________________________________ summary ____________________________________
ERROR:   py26: InterpreterNotFound: python2.6
ERROR:   py27: commands failed
ERROR:   py32: commands failed

@obiwanus
Copy link
Author

obiwanus commented Feb 5, 2014

Those are very strange errors, and googling doesn't help much. Just tried to run the tests on another Ubuntu machine (I use Debian myself) and they passed. What I can suggest is:

  1. Create a virtualenv manually, install pytest into it and run py.test from it - if it fails, then one of the problems is in pytest
  2. If you have had tox previously installed, try to update it: sudo pip install -U tox
  3. Finally, you can create a fresh virtual machine and try them there

Obviously the problem is in the environment, which doesn't like either tox or pytest.

@kmike kmike mentioned this pull request Apr 16, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants