Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 450762 - dev-python/unittest2: tests fail with Python 3.3
Summary: dev-python/unittest2: tests fail with Python 3.3
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL: https://code.google.com/p/unittest-ex...
Whiteboard:
Keywords:
Depends on: 450616
Blocks: python-3.3
  Show dependency tree
 
Reported: 2013-01-07 21:05 UTC by Michał Górny
Modified: 2013-10-05 14:51 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Build log for py3.3 (build-python3.3.log,9.76 KB, text/plain)
2013-01-07 21:05 UTC, Michał Górny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-01-07 21:05:56 UTC
Created attachment 334750 [details]
Build log for py3.3

FAIL: test_loadTestsFromName__unknown_module_name (unittest2.test.test_loader.Test_TestLoader)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/portage/dev-python/unittest2-0.5.1-r300/work/unittest2py3k-0.5.1-python3_3/lib/unittest2/test/test_loader.py", line 240, in test_loadTestsFromName__unknown_module_name
    loader.loadTestsFromName('sdasfasfasdf')
ImportError: No module named 'sdasfasfasdf'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/portage/dev-python/unittest2-0.5.1-r300/work/unittest2py3k-0.5.1-python3_3/lib/unittest2/test/test_loader.py", line 242, in test_loadTestsFromName__unknown_module_name
    self.assertEqual(str(e), "No module named sdasfasfasdf")
AssertionError: "No module named 'sdasfasfasdf'" != 'No module named sdasfasfasdf'
- No module named 'sdasfasfasdf'
?                 -            -
+ No module named sdasfasfasdf
Comment 1 Tolga Dalman 2013-05-03 10:19:51 UTC
Shouldn't this package be masked for Python 3.3 ? Also, it should be blocked by Bug #450616.
Comment 2 Pacho Ramos gentoo-dev 2013-10-01 21:40:33 UTC
Is this concrete test failure implying unittest2 is not working with python-3.3? In other distributions like Mageia they are simply skipping the failing tests :/
Comment 3 Dirkjan Ochtman (RETIRED) gentoo-dev 2013-10-02 06:24:51 UTC
Yeah, I guess skipping this test (or patching it) would be entirely fair.
Comment 4 Pacho Ramos gentoo-dev 2013-10-02 21:16:18 UTC
Looks like tests are run differently on Mageia than Gentoo, they use nosetests:
http://svnweb.mageia.org/packages/cauldron/python-unittest2/releases/0.5.1/2.mga3/SPECS/python-unittest2.spec?view=markup

(and skip nosetests test_unittest2.py)

We have:
scripts/unit2 discover -s lib
Comment 5 Pacho Ramos gentoo-dev 2013-10-05 07:30:21 UTC
What about this way to skip the test?
--- /home/pacho/gentoo-x86/dev-python/unittest2/unittest2-0.5.1-r1.ebuild	2013-09-11 16:07:31.000000000 +0200
+++ ./unittest2-0.5.1-r1.ebuild	2013-10-05 09:26:22.000000000 +0200
@@ -27,6 +27,10 @@
 	# Disable versioning of unit2 script to avoid collision with versioning performed by distutils_src_install().
 	sed -i -e "/'%s = unittest2:main_' % SCRIPT2,/d" setup.py || die
 
+	if use python_targets_python3_3; then
+		rm "${WORKDIR}"/${PY3_P}/unittest2/test/test_loader.py || die
+	fi
+
 	distutils-r1_python_prepare_all
 }
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-05 14:51:56 UTC
Fixed through removing the pointless additional message assertion in -r2.