lunaryorn/pyudev — Issue #43: Test failures in pyudev 0.15
Author: Arfrever
Created: 2012-03-02 04:47:15+00:00
State: open

Some tests fail in pyudev 0.15. These tests were absent in pyudev 0.14. 2 of these tests fail only in Python 2.6.

```
$ py.test-2.6
============================= test session starts ==============================
platform linux2 -- Python 2.6.7 -- pytest-2.2.3
collected 619 items / 1 errors

tests/test_core.py ........
tests/test_device.py ....................................s.s.ss.ss.s.s.ss.s.ssssssssssssssssssss.F...........ssssssssssssssssssssxxxxxx.xxx..........................................................................................................................................................................................................xx..xxxxx..............................................................................................................................................................................ssssssssss
tests/test_enumerate.py ..............ssssssssss.......s...
tests/test_monitor.py .........................s.s.s
tests/test_observer.py .............sss
tests/test_util.py ................F

==================================== ERRORS ====================================
____________________ ERROR collecting tests/test_libudev.py ____________________
tests/test_libudev.py:74: in pytest_generate_tests
> for function in get_libudev_functions():
tests/test_libudev.py:54: in get_libudev_functions
> check_call(['gccxml', LIBUDEV_H, '-fxml={0}'.format(stream.name)])
/usr/lib64/python2.6/subprocess.py:483: in check_call
> retcode = call(*popenargs, **kwargs)
/usr/lib64/python2.6/subprocess.py:470: in call
> return Popen(*popenargs, **kwargs).wait()
/usr/lib64/python2.6/subprocess.py:623: in __init__
> errread, errwrite)
/usr/lib64/python2.6/subprocess.py:1141: in _execute_child
> raise child_exception
E OSError: [Errno 2] No such file or directory
=================================== FAILURES ===================================
________________ TestDevice.test_from_device_file_non_existing _________________

self =
context =
tmpdir = local('/var/tmp/portage/dev-python/pyudev-0.15/temp/pytest-0/test_from_device_file_non_existing0')

def test_from_device_file_non_existing(self, context, tmpdir):
filename = tmpdir.join('test')
assert not tmpdir.check(file=True)
with pytest.raises(EnvironmentError) as excinfo:
Device.from_device_file(context, str(filename))
> assert excinfo.value.errno == errno.ENOENT
E AttributeError: 'tuple' object has no attribute 'errno'

tests/test_device.py:170: AttributeError
______________________ test_get_device_type_not_existing _______________________

tmpdir = local('/var/tmp/portage/dev-python/pyudev-0.15/temp/pytest-0/test_get_device_type_not_existing0')

def test_get_device_type_not_existing(tmpdir):
filename = tmpdir.join('test')
assert not tmpdir.check(file=True)
with pytest.raises(EnvironmentError) as excinfo:
_util.get_device_type(str(filename))
> assert excinfo.value.errno == errno.ENOENT
E AttributeError: 'tuple' object has no attribute 'errno'

tests/test_util.py:153: AttributeError
==== 2 failed, 523 passed, 78 skipped, 16 xfailed, 1 error in 25.84 seconds ====
$ py.test-2.7
============================= test session starts ==============================
platform linux2 -- Python 2.7.3 -- pytest-2.2.3
collected 619 items / 1 errors

tests/test_core.py ........
tests/test_device.py ...................................ss.s.s.ssssss.s..s..s..s.sssssssssssssss.............ssssssssssssssssssssxxxxxxx.x...........................................................................................................................................................................................................x.xxxxx.x..............................................................................................................................................................................ssssssssss
tests/test_enumerate.py ..............ssssssssss.......s...
tests/test_monitor.py .........................s.s.s
tests/test_observer.py .............sss
tests/test_util.py .................

==================================== ERRORS ====================================
____________________ ERROR collecting tests/test_libudev.py ____________________
tests/test_libudev.py:74: in pytest_generate_tests
> for function in get_libudev_functions():
tests/test_libudev.py:54: in get_libudev_functions
> check_call(['gccxml', LIBUDEV_H, '-fxml={0}'.format(stream.name)])
/usr/lib64/python2.7/subprocess.py:506: in check_call
> retcode = call(*popenargs, **kwargs)
/usr/lib64/python2.7/subprocess.py:493: in call
> return Popen(*popenargs, **kwargs).wait()
/usr/lib64/python2.7/subprocess.py:679: in __init__
> errread, errwrite)
/usr/lib64/python2.7/subprocess.py:1249: in _execute_child
> raise child_exception
E OSError: [Errno 2] No such file or directory
========= 528 passed, 76 skipped, 15 xfailed, 1 error in 42.28 seconds =========
```